I am trying to run Excel macros from a Jenkins Windows service on Windows 7 64-bit VM. I have a batch file that specifies VBS files. Then in the VBS files, the Excel macros are listed. The batch files run fine locally, but when I run it from Jenkins, I get the following error:
Microsoft VBScript runtime error: ActiveX component can't create object: 'Excel.Application'
The error seems to occur on each instance of the following in the VBS files:
Set xlApp = CreateObject("Excel.Application")
Just searching around, I see that lots of other people have had problems with the version of cscript
being used to execute the VBS files. On 64-bit computers, it seems that the 32-bit version of cscript
must be used. But no matter how I try to force that version of cscript
to be used, Jenkins seems to ignore it and display the same error, which makes me think that the cscript
version is not the cause of my error.
I do have macros enabled in Excel and checked the ActiveX settings too. Like I said, double-clicking the batch file, everything works fine. There's gotta be something weird Jenkins is doing to cause the problem.
Any ideas?