'Document not saved' error - excel workbook

P

philip herman

Tried everything including allowing full control to ASPNET user to
folder containing workbook but stiil get
'System.Runtime.InteropServices.COMException: Document not saved'
exception. Any ideas?


ApplicationClass excapp = new ApplicationClass();

WorkbookClass wb = null;
string sPath = Request.ApplicationPath + @"\aging.xls";
wb = (WorkbookClass)excapp.Workbooks.Open(Server.MapPath(sPath),
Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value);

excapp.Run((object)Convert.ToString("RunReport"),Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,M
ssing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value);

wb.Save();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top