1

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?

tommy2479
  • 53
  • 1
  • 2
  • 4
  • Check out [this StackOverflow post](https://stackoverflow.com/questions/881132/retrieving-the-com-class-factory-for-component-failed). Same error, so I assume same solution (it was for me, but not flagging as duplicate in case this is different issue) – G42 Jul 10 '17 at 12:21
  • Thnx @gms0ulman . Currently IT-dep. is checking your provided solutions. Furthermore I tested to change the Jenkins --> Services set to Log on as: "Local System account". This brings me some steps further, but more unknown errors pop up, so I guess it has to do with the fact that Jenkins and Excel should be the same in Log On settings. Does anyone know how I should code or set that when Excel is called by Jenkins via the powershell script to also Log on as: "This Account". In Excel 2010 this was not a problem. I guess between Excel 2010 and Excel 2016 something changed regarding this? – tommy2479 Jul 20 '17 at 09:04

0 Answers0