Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default HRESULT: 0x800A03EC exception when trying to hide a sheet.

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.xlWBATWorkshee t);
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_Visi ble(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.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

Does anyone know the solution. I just need to hide the sheet. That's all.

Thanks in Advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default HRESULT: 0x800A03EC exception when trying to hide a sheet.

How many worksheets do you have in the workbook ?
You can't hide the last one; one must be visible.

NickHK

"VVVVVK" wrote in message
...
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.xlWBATWorkshee t);
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_Visi ble(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.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

Does anyone know the solution. I just need to hide the sheet. That's all.

Thanks in Advance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a worksheet throws "Exception from HRESULT: 0x800A03EC." i3tech Excel Programming 4 August 15th 06 01:37 PM
Exception from HRESULT: 0x800A03EC nano2k New Users to Excel 0 July 21st 06 12:15 PM
Exception from HRESULT: 0x800A03EC. at Microsoft.Office.Interop.Excel.WorkbookClass.get_VBProject() [email protected] Excel Programming 0 April 11th 06 04:40 PM
HRESULT: 0x800A03EC setting DataSource for pivot tables. [email protected] Excel Programming 1 January 18th 06 08:59 AM
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. Steven Excel Programming 1 November 5th 03 06:59 PM


All times are GMT +1. The time now is 10:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"