Solved

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

Posted on 2011-09-29
13
1,297 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
ID: 36890222
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
ID: 36890234
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
ID: 36890646
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 14

Expert Comment

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

Author Comment

by:LoGa1234567890
ID: 36891705
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
ID: 36892686
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
 

Author Comment

by:LoGa1234567890
ID: 36894914
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
ID: 36895615
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
ID: 36902879
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
ID: 36906785
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
ID: 36907130
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
ID: 36914935
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
ID: 36972772
Accept as solution.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

808 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