I'm working on a Windows hpc and I'm trying to make a small program which run excel's macro on the grid. I'm using the Com Interop API
It works fine on my computer, it runs the different VBA macros, but when I'm using it on the grid, it doesn't work anymore. The Open method doesn't work properly.
workBook = excelApp.Workbooks.Open(path, Type.Missing,false, Type.Missing, Type.Missing, Type.Missing, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Here is the exception translated from french :
Exception Found: Type: System.Runtime.InteropServices.COMException Message: Microsoft Office Excel can't access the file
\server\path\test.xls. There is multiple possibilities :
- The file's name or the path doesn't existe
- The file is currently used par another program
- The workbook you are trying to use has the same name of another workbook already open
Source: Microsoft Office Excel
Stacktrace: at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad) at namespace.ExcelFile.readExcel(Application excelApp) in E:\path\ExcelFile.cs:line 37
I've tried to access the file from the compute node with the same account as the one used in the application and it works fine. I can access it, it seems that there is no other program using it, and Excel is not open.
Edit : I also can run my small application on the compute node without using the Microsoft API (head node)
What am I missing ?