PC Review


Reply
Thread Tools Rate Thread

Call Workbook_BeforeClose

 
 
=?Utf-8?B?WFA=?=
Guest
Posts: n/a
 
      2nd Aug 2007
I need to call Workbook_BeforeClose from a standard code module in the same
file...what is the syntax to do this?

Thanks.
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      2nd Aug 2007
Dim b As Boolean
Call ThisWorkbook.Workbook_BeforeClose(b)

Ensure Workbook_BeforeClose is Public and not default Private

Why not let your BeforeClose event call a procedure in an ordinary module,
the same procedure can be simply called from elsewhere

Regards,
Peter T

"XP" <(E-Mail Removed)> wrote in message
news:764A4CE2-4B53-49C8-BD86-(E-Mail Removed)...
> I need to call Workbook_BeforeClose from a standard code module in the

same
> file...what is the syntax to do this?
>
> Thanks.



 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      2nd Aug 2007
Even easier (not much but it seems easier to me) is to just use Auto_Close.
Try

Sub Auto_Close()
MsgBox "Tada"
End Sub

--
HTH...

Jim Thomlinson


"Peter T" wrote:

> Dim b As Boolean
> Call ThisWorkbook.Workbook_BeforeClose(b)
>
> Ensure Workbook_BeforeClose is Public and not default Private
>
> Why not let your BeforeClose event call a procedure in an ordinary module,
> the same procedure can be simply called from elsewhere
>
> Regards,
> Peter T
>
> "XP" <(E-Mail Removed)> wrote in message
> news:764A4CE2-4B53-49C8-BD86-(E-Mail Removed)...
> > I need to call Workbook_BeforeClose from a standard code module in the

> same
> > file...what is the syntax to do this?
> >
> > Thanks.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook_BeforeClose Ed Davis Microsoft Excel Misc 21 26th Sep 2009 01:01 AM
Workbook_Beforeclose Ed Davis Microsoft Excel Discussion 11 8th Sep 2009 07:24 PM
Workbook_BeforeClose Dave Unger Microsoft Excel Programming 3 3rd Feb 2009 03:50 PM
Workbook_BeforeClose? kartune85 Microsoft Excel Programming 6 26th Jun 2006 08:53 AM
Re: Workbook_BeforeClose Don Guillett Microsoft Excel Programming 1 31st Aug 2004 02:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:11 PM.