×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

grabbing data off web pages using excel macro

grabbing data off web pages using excel macro

grabbing data off web pages using excel macro

(OP)
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;http://www.???????

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...

 

RE: grabbing data off web pages using excel macro




Hi.

Why did you ask this question in this Attachmate forum?

This is a forum707: VBA Visual Basic for Applications (Microsoft) question.

However a solution..

CODE

ActiveWorkbook.Worksheets.Add
   With ActiveSheet.QueryTables.Add(Connection:="URL;http://www." & YourVariable & ")"

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close