excel 97 crash

S

sashi

Hi
I am trying to handle WorkbookBeforeClose event to close a
workbook, the sample code looks like below

Private Sub App_WorkbookBeforeClose(ByVal Wb As
Excel.Workbook, Cancel As Boolean)
App.EnableEvents = False
Wb.Close savechanges:=False
App.EnableEvents = True
End Sub

steps to crash
1. create a workbook with the above code
2. select enable macros option when prompted
3. create a new work book and type something
4. close new workbook
5. select No when prompted to save changes
6. try to scroll the workbook
Excel97 crashes
it will be very helpful if anybody can throw some light on
this. thanks
 

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