LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default App_WorkBookBeforeClose()

Hi ,

I have a piece of VBA code , it goes like this , the class module has
Public WithEvents app As Application

Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, _
Cancel As Boolean)
a = MsgBox("Do you really want to close the workbook?", _
vbYesNo)
If a = vbNo Then Cancel = True
End Sub
for WorkBookBeforeClose under app tab

and another module has

Public oappobject As New Class1
Sub auto_open()
Set oappobject.app = Application

End Sub

for auto_open under General tab in VBA

I saved this as Test.xla , and put under XLSTART folder .
When excel is run , my message appears twice for Excel 2003 and once
for Excel 2000. Can somebody explain the behaviour and suggest a
workaround for this .

Thanks in anticipation,
Deepa

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"