I am trying to create an automation tool for users on a web-based system that have to login. I am not able to use CreateObject because that opens a new IE window which makes the user sign-in again which then kicks them out of the current session.
How do I rewrite the following so it targets the existing IE window and clicks on a button without using CreateObject?
Sub exampleOne
Dim ie, doc
set ie = 'cannot use CreateObject - what else can I do?
set doc = ie.document
wshell.AppActivate("Sample Title")
doc.getElementByID("button").Click
End Sub
I suggest you try to refer to the example below may help you to focus existing IE window and click the button on a webpage.
Sample VBScript:
Further, you can try to understand the code example try to modify it based on your own requirements.
Thanks for your understanding.