I have a Jenkins job which calls a (windows) power shell script. Within that script I call excel by using:
$excel = new-object -comobject excel.application
$excel.visible = $true
$workbook = $excel.workbooks.open($myTool)
But after upgrading to Excel 2016 (from Excel 2010) this doesn't work anymore. Error message:
New-Object : Retrieving the COM class factory for component with CLSID {0002450
0-0000-0000-C000-000000000046} failed due to the following error: 80080005.
At myScript.ps1:99 char:20
+ $excel = new-object <<<< -comobject excel.application
+ CategoryInfo : ResourceUnavailable: (:) [New-Object], COMExcept
ion
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Comman
ds.NewObjectCommand
I tested myScript and it still works within Windows Powershell ISE, but not when using Jenkins.
I'm running Jenkins on my laptop and use in services->Log On as "this account".
Any idea what could be the issue between Excel 2016 and 2010?