+ Reply to Thread
Results 1 to 6 of 6

Web query vba

  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Question Web query vba

    Hi everyone,

    I am struggling with using a web query in excel and I hope someone can help resolve these issues.

    First of all here is the code I have so far and it works in pieces but not together:

    Please Login or Register  to view this content.
    The first part of the code creates URLs in Column I. Then I try to open each URL and import a string of data from the same cell on the temporary worksheet back to the database.

    The problems I am facing are:

    1) The loop works, but erases the URLs. I don't understand why???

    2) I can't get the URL to be sent to the web query. (I don't have any experience with this before)

    3) The vba does not wait for the web query to load the web page and continues to the copy/paste portion. Of course it copies and pastes blank cell. Is there a way to tell it to wait until the web query is completely loaded before continuing with the next line of code?

    Thanks,

    abousetta
    Attached Files Attached Files
    Last edited by abousetta; 05-15-2010 at 10:11 AM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Web query vba

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web query vba

    Thanks snb. I am having trouble testing it because I can't seem to declare UBound. What should I declare it as because everything I have tried gives me an error?

    Also I have declared the other variable as:

    Please Login or Register  to view this content.
    Is this OK or should I change any of them? Sorry I am still learning the ropes.

    abousetta

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web query vba

    Hi,

    I have one other error that I can't fix. At the code:
    Please Login or Register  to view this content.
    I get "Compile error: Invalide or unqualified reference" and it highlights .Value

    Thanks for all your help.

    abousetta

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web query vba

    Hi snb,

    Thank you for all your help. I can see the logic that you are using, but I am not yet experienced enough to debug this code. I hope you will be able to have a second look at this code.

    Thanks.

    abousetta

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web query vba

    Hi snb and everyone,

    Well I wanted to use the code that snb was kind enough to write for me but I still couldn't get to work. So I had to go back to the original code I had. Its a little primative but finally is now working. If anyone can still help me to use snb's code, I would be grateful.

    Here is the code I ended using until I find a better solution:

    Please Login or Register  to view this content.
    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1