Работать локально хорошо с этим:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Application excel = null;
Workbook wb = null;
excel = new Application();
excel.Visible = false;
excel.DisplayAlerts = false;
excel.AlertBeforeOverwriting = false;
wb = excel.Workbooks.Open(Server.MapPath(fileName), Type.Missing, false,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);
wb.Save();
wb.Close(false, null, null);
excel.Quit();
После публикации на сервере Windows 7 Ultimate x64 у меня появилась такая проблема:
Microsoft Office Excel cannot access the file: ///
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.
Как решить эту проблему: