I am getting following error while running a windows service in a remote machine.
The OS is Windows 7 (64 bit). Permission is there.
The path is correct. The file is not open either. Error occuring on opening the workbook.
Microsoft Office Excel cannot access the file '\\ntp-228\SMART_PDF_FILE_STORE\TEMPLATE\T_001.xls'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
My code is as below:
_Application xlApp = new Microsoft.Office.Interop.Excel.Application();
xlApp.DisplayAlerts = false;
object misValue = System.Reflection.Missing.Value;
_Workbook xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkBook = xlApp.Workbooks.Open(ExcelTemplateFullPath, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
_Worksheet xlWorkSheet = (_Worksheet)xlWorkBook.Worksheets.get_Item(1);