Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grabbing data off web pages using excel macro 1

Status
Not open for further replies.

wordworm

Programmer
Apr 1, 2011
1
AU
I can easily grab a web page and put it into Excel, if I know the URL.

I want to 'construct' the URL using the
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:="URL;
function.

VB doesn't apparently parse a variable within this command - so I can't write this as Add(Connection:= and then use a variable.

Is there a workaround?

If I knew where the macro scripts are located I could write the macro 'on the fly' then call it but I suspect that the macros are all scrunched up in a file somewhere and maybe not accessible.

Or maybe there's another command designed to accept parameters within it?

Thanks in advance...
 
Hi.

Why did you ask this question in this Attachmate forum?

This is a forum707 question.

However a solution..
Code:
ActiveWorkbook.Worksheets.Add
   With ActiveSheet.QueryTables.Add(Connection:="URL;[URL unfurl="true"]http://www.[/URL][b]" & YourVariable & ")"[/b]

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top