View Single Post
  #1  
Old 02-15-2019, 05:01 AM
Nico Nico is offline
Registered User
 
Join Date: Feb 2019
Posts: 12
Open Local Url with IE object

Hello,

I have a problem :

When I Run the following code, with a web URL I have not erros :

#$language = "VBScript"
#$interface = "1.0"
' Get a reference to IE's Application object
Set g_objIE = CreateObject("InternetExplorer.Application")
'g_objIE.Offline = True
g_objIE.Offline = False
g_objIE.navigate "www.google.fr"
' This loop is required to allow the IE object to finish loading...
Do
crt.Sleep 100
Loop While g_objIE.Busy


' Prevent the MenuBar, StatusBar, AddressBar, and Toolbar from
' being displayed as part of the IE window
g_objIE.MenuBar = False
g_objIE.StatusBar = False
g_objIE.AddressBar = False
g_objIE.Toolbar = False
' Set the initial size of the IE window
g_objIE.height = 500
g_objIE.width = 700
' Set the title of the IE window
g_objIE.document.Title = "Sofrastock Welcomme"

g_objIE.Visible = True
' This loop is required to allow the IE window to fully display
' before moving on
Do
crt.Sleep 100
Loop While g_objIE.Busy

' This code brings the IE window to the foreground (otherwise, the window
' would appear, but it would likely be behind the SecureCRT window, not
' easily visible to the user).
Set objShell = CreateObject("WScript.Shell")
objShell.AppActivate g_objIE.document.Title
' Once the dialog is displayed and has been brought to the
' foreground, set focus on the control of our choice...

'g_objIE.Document.All("Username").Focus

' Wait for user interaction with the dialog...
crt.Sleep 200



But when I try to Run the same code with a local URL , I have Unknown errors.
Why does this happen?

Thank you
Reply With Quote