Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Can I stop the close method in an auto close macro

I have an auto close macro running on a file that demands certain cells are
complete before closing.

Is there a way of stopping the close method within the auto close macro when
the data is not present.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Can I stop the close method in an auto close macro

Private Sub Workbook_BeforeClose(Cancel As Boolean)
'do your test and if true
Cancel = True

End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Paul" wrote in message
...
I have an auto close macro running on a file that demands certain cells

are
complete before closing.

Is there a way of stopping the close method within the auto close macro

when
the data is not present.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Can I stop the close method in an auto close macro

Bob - many thanks for your help - this is absolutely what I needed.

"Bob Phillips" wrote:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
'do your test and if true
Cancel = True

End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Paul" wrote in message
...
I have an auto close macro running on a file that demands certain cells

are
complete before closing.

Is there a way of stopping the close method within the auto close macro

when
the data is not present.




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
Don't let user close. Use macro button to close? mike Excel Programming 2 October 30th 06 01:31 PM
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure [email protected] Excel Programming 5 September 26th 06 03:11 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM
On Close Macro - stop warning message M Shannon Excel Programming 2 October 2nd 04 04:04 PM


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