+ Reply to Thread
Results 1 to 4 of 4

Not sure why im getting this error. . .

Hybrid View

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    25

    Not sure why im getting this error. . .

    Hi all,

    I'm not sure why I'm getting an "object required" error for the "serh" and "btn" veriables when I set them to ie.getelementId

    What I'm having difficulty understanding is that when I run the macro everything runs well until "set serh = ie.getelementId" thats when the debugger kicks in. but I can step through the rest of the macro and it works fine.

    Any Ideas on what I'm messing up?


    Sub get_quote()
    
    Dim ie As New InternetExplorer
    Dim serh As Object
    Dim btn As Object
    
    
    
    
    Application.ScreenUpdating = False
    
    ie.Visible = True
    ie.Navigate "URL"
    
    While ie.Busy
    
    DoEvents
    
    Wend
    
    
    Set serh = ie.document.getElementById("UHSearchBox")
    
    serh.Value = Cells(3, 1)
    
    Set btn = ie.document.getElementById("UHSearchProperty")
    
    btn.Click
    
    
    End Sub

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Not sure why im getting this error. . .

    Possibly

    ie.Navigate "URL"
    Try

    ie.Navigate = "URL"
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Not sure why im getting this error. . .

    I figured out the issue.

    apparently "ie.busy" doest always work. So I had to change that portion of the code to read

    While ie.Busy Or ie.ReadyState <> READYSTATE_COMPLETE
    Thank you for your time though!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Not sure why im getting this error. . .

    For future reference, please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA ERROR: run time error 1004: Application-defined or Object-defined error in excel 2013
    By AnanthKrishna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2015, 06:16 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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