I have this beast as an error. Did my research and found some posts here as well but did not do any good for me.
Here is what I did. I had an error regarding issue rights with COM objects so I gave access rights under component services for Microsoft Excel application now I am getting this error.
Here is some information regarding this
1. Gave rights to ASPNET and network service to my web app directory to try to fix this error.
2. The exact same process works on my Windows 2003 server and my Windows 7 development machine. I am trying to get this going on a different windows 2003 machine that is outside of our domain.
3. Developing on windows 7 64 bit with office 2010 installed. Also excel 2010 is installed on my Web server
4. Here is the code that is causing the error: The last line is causing the error.:
GC.Collect();
MyXl = new Microsoft.Office.Interop.Excel.Application();
MyXl.Visible = false;
MyWb = (Microsoft.Office.Interop.Excel._Workbook)(MyXl.Workbooks.Add(Missing.Value));
int test = 0;
MySheet = (Microsoft.Office.Interop.Excel._Worksheet)MyXl.ActiveSheet;
if (reader.HasRows)
{
int InRow = 2;
for (int i = 0; i < NumberOfColumns; i++)
{
MySheet.Cells[1, i + 1] = reader.GetName(i);
}
while (reader.Read())
{
for (int j = 0; j < NumberOfColumns; j++)
{
MySheet.Cells[InRow, j + 1] = reader.GetValue(j).ToString();
}
InRow = InRow + 1;
}//=IF(A4="","",CONCATENATE("*",A4,"*"))
}
MySheet.get_Range("A1", "Z1").Font.Bold = true;
MyRange = MySheet.get_Range("A1", "Z1");
MyRange.EntireColumn.AutoFit();
string FullPath = Url + Filename;
//RemoveFiles(Url);
MyWb.SaveAs(FullPath, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlShared, false, false, null,null,null);
Oh Lord, you can image where it goes from here.
He fixes the cable?
Did you check if it's a permission issue? It's possible that you are trying to save the file to a location and .NET doesn't have the permissions to write to that location.
Marked as answer by Vince Xu - MSFT on Aug 18, 2010 05:19 AM
Create directory “C:\Windows\SysWOW64\config\systemprofile\Desktop ” (for 64 bit Windows) or “C:\Windows\System32\config\systemprofile\Desktop ” (for 32 bit Windows)
Set Full control permissions for directory Desktop (for example in Win7 & IIS 7 & DefaultAppPool set permissions for user
“IIS AppPool\DefaultAppPool”
I have recently inherited an app developed by someone else that we migrated to a windows 2008 server and after working through a bunch of the errors around excel automation on this server vs our old server I have finally gotten stuck with this same exception.
Moslem522, I have found your response on multiple forums around this error and applied your suggestion and I still recieve the same error, is there anything else I should look into?
Hello, I have solved my problem using your suggest, but can you explain me why I must create the folder 'DESKTOP"? What is the real problem? Thank you very much.
be05x5
Member
109 Points
158 Posts
System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save any...
Aug 02, 2010 02:47 PM|LINK
Hello good people,
I have this beast as an error. Did my research and found some posts here as well but did not do any good for me.
Here is what I did. I had an error regarding issue rights with COM objects so I gave access rights under component services for Microsoft Excel application now I am getting this error.
Here is some information regarding this
1. Gave rights to ASPNET and network service to my web app directory to try to fix this error.
2. The exact same process works on my Windows 2003 server and my Windows 7 development machine. I am trying to get this going on a different windows 2003 machine that is outside of our domain.
3. Developing on windows 7 64 bit with office 2010 installed. Also excel 2010 is installed on my Web server
4. Here is the code that is causing the error: The last line is causing the error.:
GC.Collect(); MyXl = new Microsoft.Office.Interop.Excel.Application(); MyXl.Visible = false; MyWb = (Microsoft.Office.Interop.Excel._Workbook)(MyXl.Workbooks.Add(Missing.Value)); int test = 0; MySheet = (Microsoft.Office.Interop.Excel._Worksheet)MyXl.ActiveSheet; if (reader.HasRows) { int InRow = 2; for (int i = 0; i < NumberOfColumns; i++) { MySheet.Cells[1, i + 1] = reader.GetName(i); } while (reader.Read()) { for (int j = 0; j < NumberOfColumns; j++) { MySheet.Cells[InRow, j + 1] = reader.GetValue(j).ToString(); } InRow = InRow + 1; }//=IF(A4="","",CONCATENATE("*",A4,"*")) } MySheet.get_Range("A1", "Z1").Font.Bold = true; MyRange = MySheet.get_Range("A1", "Z1"); MyRange.EntireColumn.AutoFit(); string FullPath = Url + Filename; //RemoveFiles(Url); MyWb.SaveAs(FullPath, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlShared, false, false, null,null,null);He fixes the cable?
be05x5
Member
109 Points
158 Posts
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Aug 02, 2010 08:27 PM|LINK
:( anyone????
He fixes the cable?
MikeDev
Member
38 Points
9 Posts
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Aug 12, 2010 01:07 PM|LINK
which line is causing the error?
be05x5
Member
109 Points
158 Posts
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Aug 12, 2010 01:27 PM|LINK
the last one. Line 34.
It's some security issue somewhere. This whole server is all weird.
He fixes the cable?
MikeDev
Member
38 Points
9 Posts
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Aug 12, 2010 04:58 PM|LINK
Did you check if it's a permission issue? It's possible that you are trying to save the file to a location and .NET doesn't have the permissions to write to that location.
moslem522
Member
2 Points
1 Post
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Dec 29, 2010 05:39 AM|LINK
Hello. to solve this problem do this works:
“IIS AppPool\DefaultAppPool”
With regards
padawangeek
Member
19 Points
6 Posts
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Jan 05, 2011 10:11 PM|LINK
I have recently inherited an app developed by someone else that we migrated to a windows 2008 server and after working through a bunch of the errors around excel automation on this server vs our old server I have finally gotten stuck with this same exception. Moslem522, I have found your response on multiple forums around this error and applied your suggestion and I still recieve the same error, is there anything else I should look into?
Always learning...
syynapse
Member
2 Points
1 Post
Re: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save...
Dec 03, 2012 02:13 PM|LINK
Hello, I have solved my problem using your suggest, but can you explain me why I must create the folder 'DESKTOP"? What is the real problem? Thank you very much.
Crismer