Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've built an Excel add-in that needs to execute some code when the
workbook opens. I've added the following code to the Workbook_Open event: Private Sub Workbook_Open() For Each ws In ActiveWorkbook.Worksheets If ws.Name = crFinancialsSheet Then sheetExists = True End If Next End Sub I add the add-in, close the workbook and open a new instance of Excel. At this point, the add-in throws an error because the ActiveWorkbook in the Workbook_Open event is nothing and obviously there are no sheets (I can visually see that the sheets are not there). What I'm wondering is why the ActiveWorkbook is nothing in the Workbook_Open event and is there another event that I can put my code. I need the workbook to have sheets. Thanks, alex |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ActiveWorkbook.RefreshAll | Excel Programming | |||
trouble getting addin's workbook_open procedure to recognize activeworkbook | Excel Programming | |||
ActiveWorkBook | Excel Discussion (Misc queries) | |||
activeworkbook problems | Excel Programming | |||
ActiveWorkbook.RefreshAll | Excel Programming |