Difficulties with setting window parameters for non-Office applications

Viewed 30

I have an excel application (PC W10) which launches InternetExplorer with a variety of websites then sets the window size as required. The following code works well with InternetExplorer –

myLink = “some website url”
Set myInt = CreateObject("InternetExplorer.Application") 'launch IE
With myInt
    .Height = hig
        'etc. for other parameters
End With
myInt.Navigate2 myLink 'go to website
Do While myInt.Busy 'wait until all is done before doing anything else
Loop

But now that many websites no longer support IE, I need to move to another browser (e.g. FireFox, Chrome or Edge) –

myLink = “some website url”
myInt = “FireFox”
appName = “firefox.exe"
appPath = "C:\Program Files\Mozilla Firefox\"
myApp = Shell(appPath & appName & " -url " & myLink)
    'Up to here all is well
    'The intended code below obviously does not work
With myInt
    .Height = hig
        'etc. for other parameters
End With
Do While myInt.Busy
Loop

The above launches the browser and website OK, but I cannot find how to control the window’s dimensions and create a wait loop.

I would greatly appreciate any direction anyone could give me.

Best regards greenme

0 Answers
Related