LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Behaviour of Save as and Displayalerts

Hi,

I have a file by the name ABC format. I open this file and perform a couple
of operations through macros. At the end of the operation I want to save the
file by appending today's date in the format dd-mm-yy.

This saving operation is performed at the end of the code. I have pasted the
last lines of the code where the saving operation is being performed.

It is possible that the new name of the file by which I m saving already
exists. In my case I would simply want it to be overwritten and replaced
with the new copy of the file.

The problem is that if the file exists then a message is displayed saying
that do u want to replace the file, etc.
I understand that one might supress this message by adding
application.displayalerts = false before the "Active workbook.SaveAs"
statement and then again introduce a statement application.displayalerts =
true just after the "Active workbook.SaveAs" statement.

My query is whether by using displayalerts the previous file is overwritten
or not. I tried it by creating a file of the same name( ABC 10-Jun-04.xls)
with junk data and when I ran this macro the file I did have a new and
correct file.

The concern I have is when we have a file open and use the save as option
from file menu and save the file without changing the file name in the same
location then excel prompts whether we want to replace the existing file. In
that the option yes and no appears and by default "No" is active. Hence, the
question is if , No is active in this case and in the similar line when we
do application.displayalerts = false in the macro case doesnt excel take or
assume our default response to be "No" for replacing the file. How does
excel read our response to be yes in case of application.displayalerts =
false ?


ActiveWorkbook.SaveAs filename:= _
"C:\Documents and Settings\hprasadh\Desktop\Pil\Project comparison\ABC
format " & " " & CStr(Format(Now, "dd-mmm-yy")), FileFormat:=xlNormal

Regards,
Hari
India




 
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
Displayalerts and Screenupdating Hari[_3_] Excel Programming 4 June 12th 04 11:37 AM
Application.DisplayAlerts in IE scoobydeux Excel Programming 1 April 19th 04 01:28 AM
Can't Set DisplayAlerts to False Mark Driscol Excel Programming 0 April 7th 04 06:11 PM
Can't Set DisplayAlerts to False Mark Driscol Excel Programming 1 April 6th 04 10:45 PM
application.displayalerts Erin[_5_] Excel Programming 1 December 4th 03 03:49 PM


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