Class not registered

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,104
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi

So beyond me this one.
I am getting a runtime error in the below code.

BUT

Only when i open the excel file from a scheduled task in task scheduler.

The code runs just fine if i manually open the file

the macro is called upon workbook open BTW.

Any ideas? thanks.

dave

VBA Code:
Dim mybrowser As Selenium.ChromeDriver
Sub get_ip()
Set mybrowser = New Selenium.ChromeDriver 'error is here
mybrowser.AddArgument "--headless"
mybrowser.Get "https://www.showmyipaddress.eu/"
ip1 = mybrowser.FindElementByXPath("/html/body/div[2]/div/div/div/div[1]/div[1]").Text
'at this point i email myself the ip1.
ThisWorkbook.Save
Application.Quit
End Sub
 
Ok. I found the problem.

On the task scheduler I had to click the setting to

Configure for windows vista windows server 2008.

I had it set to windows 10. Although I am running 10.

Works now.
This didn't work for me then when i unticked "Run with highest privileges" then it worked even while it was on configure for windows 10
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,372
Messages
6,124,542
Members
449,169
Latest member
mm424

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top