SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [VBS - Object Variable Not Set Error]

    Hello all,

    I am new to VBS scripting and could nto figure this out for the life of me.

    I have a script that uses QueryTable in Excel to import in information from a webpage. There is a delay while Excel is importing. To ensure the script waits for the information is fully imported i wrote a wait function:

    set queryTableLoopWait = objExcel.WorkSheets("TempInfoSheet").Cells.Find("Getting data")
    do while (queryTableLoopWait = "something: Getting Data ...")
    wscript.sleep(100)
    set queryTableLoopWait = objExcel.WorkSheets("TempInfoSheet").Cells.Find("Getting data")
    loop

    But i keep getting a "Object variable not set" error at the do-while command. PLEASE HELP!!

    P.S.: The only way i know how to detect if the querytable is still loading is by the message "something: Getting Data ..." that appears in the excel sheet while it's loading. If anyone knows a better way please let me know.

    Thank you in advance.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it would be better if you post this in any vba forum.

    Meanwhile, check this:

    http://www.vbaexpress.com/forum/arch...p/t-30278.html

    not sure if that is what you are looking for.

  3. #3
    SitePoint Member
    Join Date
    Jul 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THANK YOU! I think the problem is fixed.


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
  •