Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default BeforeClose event won't run when closing using macro

I am using 2 workbooks in this example. I have the main log and I have
individual sheets for each employee. Since some people can't even comprehend
copy/paste, I am making a macro to select the range from their individual
sheet, copy and paste it into the main sheet, and then close the main sheet.

The problem I am having is this. In the main sheet, I have a beforeClose
event. The event works fine when you manually close the workbook, however
when the macro from the individual's workbook closes the sheet, the
beforeClose event doesn't run.

Why would this be?

Also, I did both, write the code myself and record a macro using the excel
tool. When I recorded the macro, the beforeClose event ran without any
problems.

Any help would be greatly appreciated.

Thanks,
Ed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default BeforeClose event won't run when closing using macro

when the macro from the individual's workbook closes the sheet

The only thing that would stop before_close from running is if this macro
had an Application.EnableEvents = False in it. I'd check for that.

--
Jim
"ETLahrs" wrote in message
...
|I am using 2 workbooks in this example. I have the main log and I have
| individual sheets for each employee. Since some people can't even
comprehend
| copy/paste, I am making a macro to select the range from their individual
| sheet, copy and paste it into the main sheet, and then close the main
sheet.
|
| The problem I am having is this. In the main sheet, I have a beforeClose
| event. The event works fine when you manually close the workbook, however
| when the macro from the individual's workbook closes the sheet, the
| beforeClose event doesn't run.
|
| Why would this be?
|
| Also, I did both, write the code myself and record a macro using the excel
| tool. When I recorded the macro, the beforeClose event ran without any
| problems.
|
| Any help would be greatly appreciated.
|
| Thanks,
| Ed


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
BeforeClose Event LeAnn Excel Programming 1 March 21st 08 11:10 PM
BeforeClose event help [email protected] Excel Programming 3 June 22nd 07 10:02 AM
BeforeClose Event JT Excel Programming 2 April 10th 07 03:52 PM
How can I detect .xls closing? Not BeforeClose , Like AfterClose? Zoo Excel Programming 3 April 14th 06 12:49 PM
How to get out of BeforeClose event without closing? 42N83W Excel Programming 4 March 11th 05 05:33 PM


All times are GMT +1. The time now is 04:44 AM.

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"