Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Supress SaveAs dialog box?

I have
Application.DisplayAlerts = False
Application.EnableEvents = False
wb.SaveAs strFName
Application.EnableEvents = True
Application.DisplayAlerts = True

DisplayAlerts suppresses the message that I'm overwriting a file, but will
not keep the SaveAs dialog box from popping up. I'm using XL2000, SP-3.
Any suggestions? Do I have to work through the DIalogs collection and kill
that one if it comes up?

Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Supress SaveAs dialog box?

The code you show does not cause the SaveAs dialog to show. suspect you
have this in the BeforeSave event. If so, you need to add

Cancel = True

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I have
Application.DisplayAlerts = False
Application.EnableEvents = False
wb.SaveAs strFName
Application.EnableEvents = True
Application.DisplayAlerts = True

DisplayAlerts suppresses the message that I'm overwriting a file, but will
not keep the SaveAs dialog box from popping up. I'm using XL2000, SP-3.
Any suggestions? Do I have to work through the DIalogs collection and

kill
that one if it comes up?

Ed




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Supress SaveAs dialog box?


"Ed" wrote in message
...
I have
Application.DisplayAlerts = False
Application.EnableEvents = False
wb.SaveAs strFName
Application.EnableEvents = True
Application.DisplayAlerts = True

DisplayAlerts suppresses the message that I'm overwriting a file, but will
not keep the SaveAs dialog box from popping up. I'm using XL2000, SP-3.
Any suggestions? Do I have to work through the DIalogs collection and

kill
that one if it comes up?

Ed




You can use the saved property like below

Sub CloseWithoutChanges()
ThisWorkbook.Saved = True
ThisWorkbook.Close
End Sub
Best Regards,Fredrik



  #4   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Supress SaveAs dialog box?

You are correct, Tom (as usual!). And, again, I owe you great thanks for
your help.

So it must be something about being in the Save event already, and then
invoking it again, but I'm only dealing with the one I invoke, rather than
the one I initiated to get into the event(?).

Ed

"Tom Ogilvy" wrote in message
...
The code you show does not cause the SaveAs dialog to show. suspect you
have this in the BeforeSave event. If so, you need to add

Cancel = True

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I have
Application.DisplayAlerts = False
Application.EnableEvents = False
wb.SaveAs strFName
Application.EnableEvents = True
Application.DisplayAlerts = True

DisplayAlerts suppresses the message that I'm overwriting a file, but

will
not keep the SaveAs dialog box from popping up. I'm using XL2000, SP-3.
Any suggestions? Do I have to work through the DIalogs collection and

kill
that one if it comes up?

Ed






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Supress SaveAs dialog box?

the dialog is from the one you initiate manually - remember this is the
BeforeSave event. So when your code completes, the original save you
initiate puts up the dialog. Setting Cancel = True cancels the processing
of the initial triggering event.

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
You are correct, Tom (as usual!). And, again, I owe you great thanks for
your help.

So it must be something about being in the Save event already, and then
invoking it again, but I'm only dealing with the one I invoke, rather than
the one I initiated to get into the event(?).

Ed

"Tom Ogilvy" wrote in message
...
The code you show does not cause the SaveAs dialog to show. suspect

you
have this in the BeforeSave event. If so, you need to add

Cancel = True

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I have
Application.DisplayAlerts = False
Application.EnableEvents = False
wb.SaveAs strFName
Application.EnableEvents = True
Application.DisplayAlerts = True

DisplayAlerts suppresses the message that I'm overwriting a file, but

will
not keep the SaveAs dialog box from popping up. I'm using XL2000,

SP-3.
Any suggestions? Do I have to work through the DIalogs collection and

kill
that one if it comes up?

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
Can you Pre-fill file name in SaveAs dialog Jive Excel Worksheet Functions 1 November 12th 07 04:30 PM
SaveAs dialog Gary''s Student Excel Discussion (Misc queries) 2 February 23rd 06 03:11 PM
Disable Saveas Dialog Tom Ogilvy Excel Programming 0 September 15th 04 05:41 PM
Saveas Dialog Box Tom Ogilvy Excel Programming 0 September 15th 04 04:57 PM
SaveAs Dialog Arguments Frank Kabel Excel Programming 4 February 24th 04 07:25 PM


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