Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am building a VSTO C# add-in for Excel (Office 2003 and Office 2007)
I have an event handler for the Application.WorkbookOpen which refreshes data in a workbook. Prior to refreshing the data I need to clear old data and formatting. The code for this is: Excel.Range t1 = (Excel.Range)(Globals.ThisAddIn.Application.Active Sheet as Excel.Worksheet).Cells[query.StartRow, query.StartCol]; Excel.Range t2 = (Excel.Range)(Globals.ThisAddIn.Application.Active Sheet as Excel.Worksheet).Cells[query.EndRow, query.EndCol]; Excel.Range range1 = Globals.ThisAddIn.Application.get_Range(t1, t2); range1.ClearFormats(); range1.Clear(); The ClearFormats (or Clear if it is placed first) will generate an 0x800A03EC exception. Unfortunately the error message is not very helpful as it gives no indication as to why the call failed. The same code when called after the workbook has fully opened is working fine. Application.Ready is true at the point that the clear functions are called. Any ideas as to what might be going on? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error handler question in Worksheet_Change event | Excel Programming | |||
Worksheet_change event handler error | Excel Discussion (Misc queries) | |||
Creating An Application Event Handler | Excel Programming | |||
Run-time error '424' in VBA event handler on XL shutdown | Excel Programming | |||
Application level event handler broken in 2003SP1 ? | Excel Programming |