Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run marco to send a excel file by email(lotus note) | Excel Discussion (Misc queries) | |||
Marco To Save Column A7 As A .txt File. | Excel Worksheet Functions | |||
save file via Marco | Excel Programming | |||
VBA - on a button event, open another closed file, post changes, close file | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |