I’m trying to write a bit of VBScript to open a browser on a specific webpage. Ultimately this webpage would be unique per script. At the moment I have the following code which works:
Dim objShell
objShell = CreateObject("Shell.Application")
objShell.ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "www.google.ie", "", "", 1)
But I would like to get the following working:
Dim iURL As String
Dim objShell
iURL = "www.google.ie"
objShell = CreateObject("Shell.Application")
objShell.ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", iURL, "", "", 1)
Any ideas what it is I’m doing wrong? Any help would be greatly appreciated.
No
As Stringas VBScript is not strongly type, you need asetwhen you create an instance of the COM object & no parens around the method call;Or if chrome is the default