View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Amit Shanker Amit Shanker is offline
external usenet poster
 
Posts: 25
Default Workbook_BeforeClose problem

It's in my add-in's workbook event handler module, as follows :

Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
DeleteCommandBar
End Sub

Private Sub Workbook_Open()
CreateCommandbar
End Sub



"Juan Pablo González" wrote in message
...
It shouldn't. Where do you have your code to delete the toolbar ?

--
Regards

Juan Pablo González

"Amit Shanker" wrote in message
...
The add-in is always invisible - it is just creating my toolbar. My

question
refers to when the user activates the 'X' button on the workbook he is
working on. My toolbar should not disappear if the user hits 'Cancel' at

the
prompt for saving his work.

"Juan Pablo González" wrote in message
...
The users closes the addin "manually" using the X button ? if so,

then,
why
do you have the Addin visible ? the idea is that it should be

"invisible"
to
the user, and that they could only "close" it using Tools | Addins OR
closing the application.

--
Regards

Juan Pablo González

"Amit Shanker" wrote in message
...
Running Office XP on Windows XP Home Edition

I am successfully creating a custom toolbar 'on the fly' via an

Excel
add-in. However, when I click the close button on the active

workbook
Excel
prompts me to save it, and at this moment my custom toolbar

disappears
as
it
gets deleted by a Workbook_BeforeClose event.

My question is, if a user clicks 'Cancel' when the workbook save

prompt
comes up, how can I still retain my custom toolbar ? In other words,

my
toolbar should disappear only when Excel application gets closed.

Thanks,
Amit