Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Marco Run on File Close

I have a macro that I want to run when/before the file closes.
I tried to call the procedure using the following code, but the procedure
did not run.

Private Sub Workbook_BeforeClose()
Call Clear_Details
End Sub


Any help?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Marco Run on File Close

Hi Grant

Where have you copy/paste this event ?

It must be in the Thisworkbook module

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Grant" wrote in message ...
I have a macro that I want to run when/before the file closes.
I tried to call the procedure using the following code, but the procedure did not run.

Private Sub Workbook_BeforeClose()
Call Clear_Details
End Sub


Any help?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Marco Run on File Close

That fixed it.

Thanks!



"Ron de Bruin" wrote in message
...
Hi Grant

Where have you copy/paste this event ?

It must be in the Thisworkbook module

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Grant" wrote in message
...
I have a macro that I want to run when/before the file closes.
I tried to call the procedure using the following code, but the procedure
did not run.

Private Sub Workbook_BeforeClose()
Call Clear_Details
End Sub


Any help?

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
jon jon is offline
external usenet poster
 
Posts: 18
Default Marco Run on File Close

Did you get an error message, or did Clear_Details simply
fail to run?

The location of the code for Clear_Details could cause
this problem. If the code is in a module and the sub is
delcared Private, you won't be able to run it from the
workbook_beforeclose event. Try making it public, or
moving the code to the general declarations section of
the workbook.

-Jon


-----Original Message-----
I have a macro that I want to run when/before the file

closes.
I tried to call the procedure using the following code,

but the procedure
did not run.

Private Sub Workbook_BeforeClose()
Call Clear_Details
End Sub


Any help?

Thanks


.

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
run marco to send a excel file by email(lotus note) Wu Excel Discussion (Misc queries) 1 December 12th 09 05:42 AM
Marco To Save Column A7 As A .txt File. Chris Excel Worksheet Functions 11 May 30th 08 10:20 AM
save file via Marco Tom Excel Programming 4 July 26th 04 01:29 PM
VBA - on a button event, open another closed file, post changes, close file Fio Excel Programming 0 March 1st 04 01:08 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


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

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

About Us

"It's about Microsoft Excel"