PC Review


Reply
Thread Tools Rate Thread

BeforeClose event won't run when closing using macro

 
 
ETLahrs
Guest
Posts: n/a
 
      6th Jun 2008
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 With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      6th Jun 2008
>>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" <(E-Mail Removed)> wrote in message
news:3DD988F7-D9EF-4A4C-8F0D-(E-Mail Removed)...
|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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BeforeClose Event LeAnn Microsoft Excel Programming 1 21st Mar 2008 11:10 PM
BeforeClose event help azu_daioh@yahoo.com Microsoft Excel Programming 3 22nd Jun 2007 10:02 AM
BeforeClose Event =?Utf-8?B?SlQ=?= Microsoft Excel Programming 2 10th Apr 2007 03:52 PM
How can I detect .xls closing? Not BeforeClose , Like AfterClose? Zoo Microsoft Excel Programming 3 14th Apr 2006 12:49 PM
How to get out of BeforeClose event without closing? 42N83W Microsoft Excel Programming 4 11th Mar 2005 05:33 PM


Features
 

Advertising
 

Newsgroups
 


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