Hanlde "New Workbook" Task Pane Events

P

Patrick Hampton

We have created a VSTO addin for Excel 2003 and have written code to manage
creation of new workbooks. However, we have been unable to find a control or
an event that we can hook to that would allow us to run our code when the
user creates a new workbook from the "New Workbook" task pane. Can anyone
tell me how to accomplish this?
 
P

Patrick Hampton

Unfortunatly we need a BeforeWorkbookOpen event and there is no such event at
the application level in Excel. Is there a workaround for this?
 
H

Harlan Grove

Patrick Hampton said:
Unfortunatly we need a BeforeWorkbookOpen event and there is no such event
at
the application level in Excel. Is there a workaround for this?
....

The art of kludgery is dead.

The Excel Application class provides events named NewWorkbook and
WorkbookOpen. Even if they don't fire before the workbook opens, you could
use it either to save newly created workbooks, close the user's workbook,
run your initialization code, and reopen the user's workbook or run your
initialization code after the user's workbook is open. Depends on what you
want to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top