Problem with IE in vba

dmarop

Registered User.
Local time
Today, 05:15
Joined
May 17, 2013
Messages
41
Hello,

I will need your help for the following problem.

I am using the object of Internet Explorer in Access and open a website. While it was working normally, now I take the run time error 462.

The window of Internet Explorer opens correctly. The error is in IE.Visible = True or if it is overcome this step makes the same in the Complete.

Code:
    Set IE = CreateObject("InternetExplorer.Application")
    IE.navigate LoginUrl
    IE.Visible = True
    IE.Silent = True

The strange is that I run the same code in 2 different pc and the specific problem exists only in the one, in the other is working normally.

Can you tell me what I have to do to solve this problem?

Thank you!
Dimitris
 
The answer to any undescribed error is 42. If you want a better bet then you need to supply the error text.
 
Hi,

The error text for the 462 that is shown is the following:

The remote server machine does not exists or is unavailable

Sometimes, shows and the run time error -2147023179
The text of the error is:
Automation error
The interface in unknown

My opinion is that it doesn’t found the window of internet explorer. The object IE is empty.
 
"The remote server machine does not exists or is unavailable " can be lost connection, time out on server, perhaps firewall ..

The thing to check is if the thing connects if you manually open IE and navigate to the site in question. Otherwise, plug the text into google - plenty of suggestions
 
But I think the installation sucks, because timeout shouldn't affect the .Visible or .Silent ... Try repairing it. What happens if you put .Visible and .Silent first?
 
I have already made search into google for the specific message errors but I have not managed to solve the problem.

If I put .Visible and .Silent first then the error is on the Complete.

In any case after running .Navigate LoginUrl the object of IE is empty.

Also, I made reset Internet Explorer settings.

I mention that the code runs normally on another pc.

Do you have any other suggestion?
 
Yes. Read what is written and answer the questions.

1. "The thing to check is if the thing connects if you manually open IE and navigate to the site in question. "

2. " the installation sucks .... Try repairing it. "
 
Thank you for your answer.

1 If I open manually IE, the navigation of the site is correctly.

2 What do you mean “the installation sucks … Try repairing it.”? Can you explain me?
 
I would like to see the whole code in that procedure and not only a few codelines, you mention "complete" but you didn't show that code line!
Is both computer running the same Windows version and IE version?
Did you copy the database from the computer which does not run okay, onto the other computer or how did you test it?
 
Hello,

The code is :

Code:
Sub GoToWebSite()
    Dim IE As Object
    Dim sURL As String
    sURL = "www.mysite.com"
    Set IE = CreateObject("InternetExplorer.Application")

    IE.Visible = True
    IE.Silent = True
    IE.navigate sURL

    Do
        DoEvents
    Loop Until IE.readyState = 4

End Sub

Yes, and the 2 computer running in Windows 7 and IE 11.

I have copy the database from the computer which does not run okay, into the other. Some days ago the code was running normally.

What can i do?
 
Last edited:
By me it runs okay - login page does show up!
Windows 8, IE 10.
I would try to recovery the Windows system to an earlier restore point.
Remark please, it is what I would do, it is on your own risk!
 
Hello,

Thank you for your answer.

Can you explain me what you mean that it is with my own risk? What I have to do I don’t understand.
 
Your code works for me IE11 windows 8.1
 
Your code works for me IE11 windows 8.1
Similar setup so there's no point in me testing this.

I believe that you're getting this error due to a security setting on your IE. I don't remember what the setting is actually called but look it up. 'Protection' or 'zones' or something along those lines.
 
Hello,

Thank you for your answer.

Can you explain me what you mean that it is with my own risk? What I have to do I don’t understand.
"On your own risk", if something get mixed up, (normally it doesn't)!
Below is a link how to restore to an earlier point.
http://windows.microsoft.com/da-dk/...ur-pc-undo-system-changes-with-system-restore
Take also a look at the security setting mention by vbaInet.
Also empty the cache does sometimes help by inexplicable failure.
 
I agree with vbaInet. It could be a security issue. Can you try going to another URL like Google and see if that works.

my guess is that when you "set IE" it is set at a certain security level. But your url is changing the security level of IE and thus the IE object you set before is now gone / changed.

As suggested to prove my guess try another website like google.com and see if your code works.
 

Users who are viewing this thread

Back
Top Bottom