I have two servers where my application was deployed, in that application, I am importing an excel file, in my first server I can successfully copy the excel and save it as csv file coming from client computer, but in my second server I can successfully copy the excel file to the server but I can't save it as csv file and there is a message that appears telling..
Cannot be accessed. The file may be corrupted, located on a server that is not responding, or read only
here is my code in opening an excel file and save it as csv
private void SaveAsCSV(ref string fileName)
{
string path = Path.ChangeExtension(fileName, ".csv");
this.workBook_ = this.excelApplication_.Workbooks.Open(fileName);
this.workSheet_ = (Worksheet)this.workBook_.Worksheets[1];
this.workBook_.SaveAs(path, Microsoft.Office.Interop.Excel.XlFileFormat.xlCSVWindows);
fileName = path;
}
I tried to check my registry using this site: [http://ift.tt/2j1duus] and the registry of second server is correct
I also tried to replicate the problem using my first server where I uninstalled the Microsoft Office 2013 and change it to Microsoft Office 2010 (MS Office 2010 is the one installed in my second server) but I can still successfully saved the excel as csv.
There is also an existing "Desktop" folder in this path C:\Windows\System32\config\systemprofile
It is in System32 because my MS Office is 32 bit.
Aucun commentaire:
Enregistrer un commentaire