[Upload Beta] try to create IE multiple times

This commit is contained in:
zilmar 2015-09-29 14:32:39 +10:00
parent f1fc32c74c
commit f37195bc89
1 changed files with 15 additions and 6 deletions

View File

@ -16,15 +16,24 @@ IE.Quit
function CreateIeWindow () function CreateIeWindow ()
on error resume next on error resume next
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
if IE is nothing then Set CreateIeWindow = nothing
For count = 0 to 100
WScript.StdOut.WriteLine count & ": Trying to create InternetExplorer"
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
if not IE is nothing then
IE.Visible = True
WScript.StdOut.WriteLine IE.HWND
Set CreateIeWindow = IE
exit for
end if
WScript.Sleep 100
Next
if CreateIeWindow is nothing then
WScript.StdOut.WriteLine "Failed to create InternetExplorer.Application" WScript.StdOut.WriteLine "Failed to create InternetExplorer.Application"
WScript.Quit WScript.Quit
end if end if
IE.Visible = True
WScript.StdOut.WriteLine IE.HWND
Set CreateIeWindow = IE
End Function End Function
Sub Wait(IE) Sub Wait(IE)