V
VVVVVK
Hi,
I am trying to set the visibility of an Excel sheet to xlSheetVeryHidden.
But I am getting an HRESULT: 0x800A03EC exception.
The code is given below:
Microsoft.Office.Interop.Excel.Application m_Excel;
Microsoft.Office.Interop.Excel.Workbook m_WorkBook;
Microsoft.Office.Interop.Excel.Worksheet m_worksheet;
m_Excel = new Application();
m_Excel.Visible = false;
m_Excel.DisplayAlerts = false;
m_WorkBook =
m_Excel.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
Worksheet sh = (Worksheet) m_WorkBook.Sheets[1];
sh.Visible = XlSheetVisibility.xlSheetVeryHidden;
At the last line above I get the exception. Stack Trace is here.
[COMException (0x800a03ec): Exception from HRESULT: 0x800A03EC.]
Microsoft.Office.Interop.Excel._Worksheet.set_Visible(XlSheetVisibility
RHS) +0
eMotion.DAM.Logic.Spreadsheet..ctor() in
c:\inetpub\wwwroot\excelop\export.cs:34
ExcelOp.WebForm1.ExcelWrite_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\excelop\webform1.aspx.cs:53
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
Does anyone know the solution. I just need to hide the sheet. That's all.
Thanks in Advance.
I am trying to set the visibility of an Excel sheet to xlSheetVeryHidden.
But I am getting an HRESULT: 0x800A03EC exception.
The code is given below:
Microsoft.Office.Interop.Excel.Application m_Excel;
Microsoft.Office.Interop.Excel.Workbook m_WorkBook;
Microsoft.Office.Interop.Excel.Worksheet m_worksheet;
m_Excel = new Application();
m_Excel.Visible = false;
m_Excel.DisplayAlerts = false;
m_WorkBook =
m_Excel.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
Worksheet sh = (Worksheet) m_WorkBook.Sheets[1];
sh.Visible = XlSheetVisibility.xlSheetVeryHidden;
At the last line above I get the exception. Stack Trace is here.
[COMException (0x800a03ec): Exception from HRESULT: 0x800A03EC.]
Microsoft.Office.Interop.Excel._Worksheet.set_Visible(XlSheetVisibility
RHS) +0
eMotion.DAM.Logic.Spreadsheet..ctor() in
c:\inetpub\wwwroot\excelop\export.cs:34
ExcelOp.WebForm1.ExcelWrite_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\excelop\webform1.aspx.cs:53
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
Does anyone know the solution. I just need to hide the sheet. That's all.
Thanks in Advance.