View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default run macro on workbook close

Nigel

In the Thisworkbook Module

Private Sub Workbook_BeforeClose(Cancel As Boolean)

'your code here

End Sub


Gord Dibben Excel MVP

On Tue, 29 Nov 2005 08:50:16 -0800, "Nigel"
wrote:

Hi,

Can you run a macro when you close a workbook or do you have do this through
a button? i konw you can run a macro on workbook open but i need it the other
way round.
if you can't, can you prevent the workbook being closed via the red crox in
the corner to force use of the button?

thanks in advance,



Nigel