Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Intercepting the file save prompt before close?

Hello,

I have a auto_close routine that intercepts the file save routine but when
the routine ends I still see the file save Yes, No Cancel dialog.

sub auto_close()


end sub

How do I disable this and continue?

Thanks in advance,
-Neil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Intercepting the file save prompt before close?

Possibly by setting

ThisWorkbook.Saved = True

Before Excel attempts to close the file.

--
Regards,
Tom Ogilvy

"Neil Bhandar" wrote in message
...
Hello,

I have a auto_close routine that intercepts the file save routine but when
the routine ends I still see the file save Yes, No Cancel dialog.

sub auto_close()


end sub

How do I disable this and continue?

Thanks in advance,
-Neil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Intercepting the file save prompt before close?

Tom, That does not work. all that does it closes the file.

sub auto_close()
reponse=msgbox (close, yes/no)
if response = no then
'tried your suggestion but does not work
ThisWorkbook.Saved = True
else
save file as is and close
endif
end sub

any other suggestions?

"Tom Ogilvy" wrote:

Possibly by setting

ThisWorkbook.Saved = True

Before Excel attempts to close the file.

--
Regards,
Tom Ogilvy

"Neil Bhandar" wrote in message
...
Hello,

I have a auto_close routine that intercepts the file save routine but when
the routine ends I still see the file save Yes, No Cancel dialog.


How do I disable this and continue?

Thanks in advance,
-Neil




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Intercepting the file save prompt before close?

You would have to use the BeforeClose Event if you want to cancel a close
that has already been initiated.

Use the Cancel arguement. Set it to True.

http://www.cpearson.com/excel/events.htm
Chip Pearson's overview of events.

--
Regards,
Tom Ogilvy

"Neil Bhandar" wrote in message
...
Tom, That does not work. all that does it closes the file.

sub auto_close()
reponse=msgbox (close, yes/no)
if response = no then
'tried your suggestion but does not work
ThisWorkbook.Saved = True
else
save file as is and close
endif
end sub

any other suggestions?

"Tom Ogilvy" wrote:

Possibly by setting

ThisWorkbook.Saved = True

Before Excel attempts to close the file.

--
Regards,
Tom Ogilvy

"Neil Bhandar" wrote in message
...
Hello,

I have a auto_close routine that intercepts the file save routine but

when
the routine ends I still see the file save Yes, No Cancel dialog.


How do I disable this and continue?

Thanks in advance,
-Neil






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
File/Close automatically saving changes without prompt Joe@SAA Excel Discussion (Misc queries) 0 June 23rd 08 10:31 PM
CLOSE ALL macro for XL2K (but with prompt to save for each file)? StargateFan[_3_] Excel Programming 2 August 10th 05 02:32 PM
Save Changes Prompt at close Johnewally Excel Discussion (Misc queries) 2 March 17th 05 09:15 PM
Excel close/save/prompt problem clayton[_2_] Excel Programming 4 January 21st 04 11:45 PM
How can I get "File Close" to prompt me to "Save Changes" ?? Charles Jordan Excel Programming 4 July 31st 03 04:01 PM


All times are GMT +1. The time now is 03:52 AM.

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"