Search code examples
vbainternet-explorerreadystate

VBA Intenet Explorer issue with loading and achiving readystate specific webbsite


Dear Friends Vba Masters, I have Issue connected with no possibility of achieved state "ready state" for my page. For others it is works for ex. google.com but I don`t know why for my page not. Strange things is that this page always load to view even in state .Visible = false , and object value od empty. I would like to create macro to login for this page and control some activities - on this page you can create some excel file to analysis. I will be very kind full. Mac.

Sub OpenKWM()
Dim URL As String
Dim IE As Object
Set IE = CreateObject("internetExplorer.application")
URL = "kwm.kromi.de"
   With IE
   .Navigate URL
  .Visible = True
  End With


 Do: Loop Until IE.readyState = READYSTATE_COMPLETE


End Sub

Solution

  • Strange things is that this page always load to view even in state .Visible = false , and object value od empty.

    If you check the relevant doc, you will find that this is actually a reasonable result. Whether the created Internet Explorer window is visible depends on whether you have called the Navigate method or the GoSearch method. When you call these methods, the window will become visible.

    Edit: After testing, I found that the cause of the problem may be Enable Protected Mode in IE settings. You can try to disable it: open IE -> Tools -> Internet Options -> security tab -> uncheck Option Enable Protected Mode. Like this:

    enter image description here