Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default 'Save as' dialog opens despite Application.DisplayAlerts = False

After serious thinking Poniente wrote :
Hi,
I'm using the following code to save a workbook under a unique name in
a single directory. This code runs on several instances of excel.
Often these save commands happen at the same time.

<begin of code
RetrySaveHandler:
On Error GoTo RetrySaveHandler
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=SaveName, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
<eoc

About 5 times a day, a 'Save as' dialog box opens asking for a file
name, with random looking default filename filled out, like:
7D2E8000
and like
9AB6B000
(i.e. not anything like the SaveName I specified and even without
the .xls extention)

If I then manually set the pointer to 'SaveName', it will save without
a problem.

Unfortunately, the errorhandler doesn't catch the above error.
Is there anyone who understands what is the problem (and/or has an
idea how to solve it ;-) )?

Regards,
Poniente


Sorry I didn't read your post earlier! I'm familiar with this issue and
have found my own solution as follows:

With Application
.EnableEvents = False: .DisplayAlerts = False
End With

'save and/or close files

With Application
.EnableEvents = True: .DisplayAlerts = True
End With

Does this help?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default 'Save as' dialog opens despite Application.DisplayAlerts = False

It happens that GS formulated :
After serious thinking Poniente wrote :
Hi,
I'm using the following code to save a workbook under a unique name in
a single directory. This code runs on several instances of excel.
Often these save commands happen at the same time.

<begin of code
RetrySaveHandler:
On Error GoTo RetrySaveHandler
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=SaveName, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
<eoc

About 5 times a day, a 'Save as' dialog box opens asking for a file
name, with random looking default filename filled out, like:
7D2E8000
and like
9AB6B000
(i.e. not anything like the SaveName I specified and even without
the .xls extention)

If I then manually set the pointer to 'SaveName', it will save without
a problem.

Unfortunately, the errorhandler doesn't catch the above error.
Is there anyone who understands what is the problem (and/or has an
idea how to solve it ;-) )?

Regards,
Poniente


Sorry I didn't read your post earlier! I'm familiar with this issue and have
found my own solution as follows:

With Application
.EnableEvents = False: .DisplayAlerts = False
End With

'save and/or close files

With Application
.EnableEvents = True: .DisplayAlerts = True
End With

Does this help?


I failed to mention that the SaveAs Filename MUST include the full path
or Excel will display the SaveAs dialog to prompt you for it. IOW, your
SaveName variable should be "save_to_folder_path\" and "filename".

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 'Save as' dialog opens despite Application.DisplayAlerts = False

On 24 jun, 16:10, GS wrote:
It happens that GS formulated :









After serious thinkingPonientewrote :
Hi,
I'm using the following code to save a workbook under a unique name in
a single directory. This code runs on several instances of excel.
Often these save commands happen at the same time.


<begin of code
* RetrySaveHandler:
* On Error GoTo RetrySaveHandler
* Application.DisplayAlerts = False
* ActiveWorkbook.SaveAs Filename:=SaveName, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
* Application.DisplayAlerts = True
<eoc


About 5 times a day, a 'Save as' dialog box opens asking for a file
name, with random looking default filename filled out, like:
* 7D2E8000
and like
* 9AB6B000
(i.e. not anything like the SaveName I specified and even without
the .xls extention)


If I then manually set the pointer to 'SaveName', it will save without
a problem.


Unfortunately, the errorhandler doesn't catch the above error.
Is there anyone who understands what is the problem (and/or has an
idea how to solve it ;-) )?


Regards,
Poniente


Sorry I didn't read your post earlier! I'm familiar with this issue and have
found my own solution as follows:


* With Application
* * .EnableEvents = False: .DisplayAlerts = False
* End With


* 'save and/or close files


* With Application
* * .EnableEvents = True: .DisplayAlerts = True
* End With


Does this help?


I failed to mention that the SaveAs Filename MUST include the full path
or Excel will display the SaveAs dialog to prompt you for it. IOW, your
SaveName variable should be "save_to_folder_path\" and "filename".

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Hi Garry,
Thanks for your suggestion! I looked into EnableEvents and it apears
to me that all kinds of events will 'disabled' by this line... so I
stick to the the solution with the separate temporary directories..
(which works fine, ... so far ;-) )
Poniente
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
'Save as' dialog opens despite Application.DisplayAlerts = False Poniente Excel Programming 0 June 24th 11 04:56 AM
Application.DisplayAlerts = False does not disable alerts Derek Dowle Excel Programming 2 December 9th 09 05:10 PM
Application.DisplayAlerts = False Jim May Excel Programming 9 August 18th 06 05:32 PM
Application.DisplayAlerts = False - Not Working [email protected] Excel Programming 3 March 1st 06 08:39 PM
Where to put DisplayAlerts = False Joe Fish Excel Programming 2 October 22nd 05 09:13 PM


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