Solved

-2147467259 Method '~' of object '~' failed

Posted on 2011-09-29
13
1,249 Views
Last Modified: 2012-08-14
Hi, Experts,

The following vb6 code run without problem in Xp, Vista home basic, Window 7, but at one laptop, that newly reinstalled back to its factory default window Vista home premium, the error message of "-2147467259 Method '~' of object '~' failed" come up. I had updated the window to its up-to-day , but the error can't be eliminated.
Any idea what is missing or wrong?
Thanks.

Private Sub Command1_Click()
    Text1 = ""
    On Error GoTo Exit1
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "http://free.timeanddate.com/clock/i1up141f/n240/tt1/tw0/tm2"
    IE.Toolbar = False
    IE.StatusBar = False
    IE.MenuBar = False
    Do While IE.Busy
        Do While IE.Busy
            DoEvents
        Loop
    Loop
    Text1 = CDate(IE.Document.getElementById("t1").InnerText)
    IE.Quit
    Set IE = Nothing
    Exit Sub
Exit1:
    MsgBox Err & vbCrLf & Err.Description
End Sub

0
Comment
Question by:LoGa1234567890
  • 8
  • 2
  • 2
  • +1
13 Comments
 
LVL 13

Expert Comment

by:khairil
Comment Utility
Hi,

It is like you have problem with the activex calling. Can you check the IE version on that laptop and compare it with others that runs well?

To zero in the problem, try remove all other references from you VB6 apps, just test the failed function. You also can unistall and reinstall the Internet Explorer on that machine.
0
 
LVL 13

Expert Comment

by:khairil
Comment Utility
You can also run process monitor from sysinternals to know the reason. filter the process monitor to your vb6 apps only and focus on registry monitor so something with NOT FOUND.
0
 

Author Comment

by:LoGa1234567890
Comment Utility
Hi khairil,

Vista usually has IE7 pre-installed. Its version: 7.0.6000.16982.

This pc, newly reinstalled with its factory default window, while running the app above, the IE browser, which was suppressed by all other pcs, pop up and show the date.

The app above doesn't have other code, and I did not add any reference to it.

I suspect the browser has setting issue.
but I don’t have other pc running IE7, they are IE8 or IE9.
I check its internet options against IE8, which has more options than IE7, match it's setting with IE8’s if possible, but the error still there.

I don't get your second message, how to monitor an app running on user machine ?
0
 
LVL 14

Expert Comment

by:Brook Braswell
Comment Utility
Have you stepped through your code to see on which line you are receiving the error ?
0
 

Author Comment

by:LoGa1234567890
Comment Utility
Hi Brook,
Using the text1 to note every previous line that run through, it doesn't go through the "DoEvents", that is where the error message come up. The error description is various, sometime show "Automation error, Unspecified error", but the error code stay the same.
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
Comment Utility
I would first change your loop code below and change it to the example in code section.

Do While IE.Busy
   Do While IE.Busy
     DoEvents
   Loop
Loop
' Wait for the page to load.
  Do While IE.Busy Or IE.ReadyState <> 4
    DoEvents
  Loop

Open in new window

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:LoGa1234567890
Comment Utility
Hi egl1044

I tried both your suggestion, but no luck.
I logged more various error message at the "DoEvents"

62
The remote server machine does not exist or is unavailable

-2147023170
Automation error
The remote procedure call failed

-2147023179
Automation error
The interface is unknown

-2147467259
Automation error
Unspecified error

0
 

Author Comment

by:LoGa1234567890
Comment Utility
Hi All,

I need to stress one thing, which I mentioned earlier, after the error message is dismissed, the IE browser show up with the date. This is not happened to other pc, that run the app without error.
0
 
LVL 14

Expert Comment

by:Brook Braswell
Comment Utility
Just for grins...
comment out these lines and see if your error still shows up.

  IE.Toolbar = False
    IE.StatusBar = False
    IE.MenuBar = False
0
 

Author Comment

by:LoGa1234567890
Comment Utility
Hi Brook1966,

I commented out those lines, the problem still there.

Now the IE browser shows up without the date but with the message "Internet Explorer cannot display the webpage".

Others computers continue to work as before with or without those lines.
0
 

Assisted Solution

by:LoGa1234567890
LoGa1234567890 earned 0 total points
Comment Utility
Hi Brook1966,

I forgot to turn on the WIFI switch on that laptop , actually, the problem stay the same.
0
 

Accepted Solution

by:
LoGa1234567890 earned 0 total points
Comment Utility
I solved the problem myself by upgrading the browser to IE8, which I did reluctantly.

I don't like to give this message to the users "Sorry, my application can not run with IE7, please upgrade your browser ! "
0
 

Author Closing Comment

by:LoGa1234567890
Comment Utility
Accept as solution.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now