Call Workbook_BeforeClose

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to call Workbook_BeforeClose from a standard code module in the same
file...what is the syntax to do this?

Thanks.
 
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
 
Even easier (not much but it seems easier to me) is to just use Auto_Close.
Try

Sub Auto_Close()
MsgBox "Tada"
End Sub
 

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

Back
Top