Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Procedure not running automatically...


The 'Private Sub Workbook_BeforeClose()' isn't running automatically (or
at all for that matter).

I've got the code in a module of it's own("B4Close") along with the
'Sub CopyData1' procedure. But when I close the Workbook it doesn't
show the MsgBox declared in 'Private Sub Workbook_BeforeClose()' but it
still shows the "Do you want to save..." dialog even tho I've stated
'...DisplayAlerts = False', also inside the 'Private Sub
Workbook_BeforeClose()'.

I haven't called the procedure from anywhere but from what I gathered,
it's not neccessary to call these particular types of procedures.

Kartune85


--
kartune85
------------------------------------------------------------------------
kartune85's Profile: http://www.excelforum.com/member.php...o&userid=35586
View this thread: http://www.excelforum.com/showthread...hreadid=555437

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Procedure not running automatically...

"I've got the code in a module of it's own("B4Close") "

this is event code it has to go in the thisworkbook module

To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is at the top-left of the spreadsheet this will
open the VBA editor, in Project Explorer double click on thisworkbook, under
your workbook name, if you don't see it press CTRL + r to open the Project
Explorer, then, paste the code in the window that opens on the right hand
side, press Alt and Q to close this window and go back to your workbook, now
this will run every time you close the workbook. If you are using excel
2000 or newer you may have to change the macro security settings to get the
macro to run. To change the security settings go to tools, macro, security,
security level and set it to medium

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"kartune85" wrote
in message ...

The 'Private Sub Workbook_BeforeClose()' isn't running automatically (or
at all for that matter).

I've got the code in a module of it's own("B4Close") along with the
'Sub CopyData1' procedure. But when I close the Workbook it doesn't
show the MsgBox declared in 'Private Sub Workbook_BeforeClose()' but it
still shows the "Do you want to save..." dialog even tho I've stated
'...DisplayAlerts = False', also inside the 'Private Sub
Workbook_BeforeClose()'.

I haven't called the procedure from anywhere but from what I gathered,
it's not neccessary to call these particular types of procedures.

Kartune85


--
kartune85
------------------------------------------------------------------------
kartune85's Profile:

http://www.excelforum.com/member.php...o&userid=35586
View this thread: http://www.excelforum.com/showthread...hreadid=555437



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
How to Dim the contents of a variable in running procedure? [email protected] Excel Discussion (Misc queries) 5 May 1st 07 12:34 AM
Running a procedure in a module on graph change tobriant[_8_] Excel Programming 0 November 7th 05 06:49 PM
Running Userform Procedure Nigel Excel Programming 1 August 19th 05 07:16 AM
Procedure to detect if an application is running Bill Excel Programming 1 November 2nd 04 03:20 AM
Procedure to detect a running application and to register it. Memorieswm Excel Programming 1 November 1st 04 09:52 PM


All times are GMT +1. The time now is 10:18 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"