YasserKhalil
YasserKhalil

Reputation: 9538

Keep Selenium driver open in Excel VBA

I have searched and found this for Python.

Is there a way to keep the driver bot open after executing the code?

I know I can use Stop at the end but I am searching for that direct way to end the code and at the same time keep the browser open.

Upvotes: 1

Views: 2323

Answers (1)

YasserKhalil
YasserKhalil

Reputation: 9538

I have worked around and it is solved by declaring the driver in the declaration section

Private bot As New Selenium.ChromeDriver

Sub Test1()
bot.get "https://www.google.com"
End Sub

Sub Test2()
bot.get "https://www.facebook.com"
End Sub

Sub QuitBott()
bot.Quit
Set bot = Nothing
End Sub

But I welcome any other solutions

Upvotes: 3

Related Questions