Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Run macro when file closes

I need to run a macro every time my workbook close. Can this be done?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Run macro when file closes

in the vb editor, double click the "thisworkbook" entry under microsoft excel
objects and select workbook from the dropdown and then before close from the
event dropdown

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' your macro
End Sub

or use

sub auto_Close()
' your macro
end sub

in a general module
--


Gary


"Patrick C. Simonds" wrote in message
...
I need to run a macro every time my workbook close. Can this be done?



Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Command Bar when excel file closes [email protected] Excel Programming 1 September 12th 07 02:07 PM
ComboBox1_Change - is triggered when file closes eugene Excel Programming 2 May 15th 06 09:43 PM
File closes without prompting to save freyabeads Excel Discussion (Misc queries) 0 March 1st 06 01:00 PM
calculation - prompting to save when file closes lpj Excel Discussion (Misc queries) 0 February 14th 06 08:27 PM
Excel 2003 File Closes In 2000 [email protected] Links and Linking in Excel 0 March 5th 05 05:20 PM


All times are GMT +1. The time now is 12:07 PM.

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"