Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default SaveAs defaults...

Using this code to save when the file already exists...

Logfile = "filename.xls"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=CurDir() & "\" & Logfile,
ConflictResolution:=xlLocalSessionChanges
Application.DisplayAlerts = True

How do you know which default (yes|no) is taken to the overwrite message?
I assume from all the posts I have seen on this topic that the "yes" default
is taken, but what if you wanted the "no" option taken?

The parm for "ConflictResolution" seems like that should handle it, but the
options shown in the help files do not cover this.

--
Regards,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SaveAs defaults...

If you want to not overwrite the file, then test for its existence and do
not execute the save

Logfile = "filename.xls"
if Dir(curdir() & "\" & logfile) = "" then
ActiveWorkbook.SaveAs Filename:=CurDir() & "\" & Logfile,
Else
msgbox "File conflict"
End if

--
Regards,
Tom Ogilvy

"John Keith" wrote in message
...
Using this code to save when the file already exists...

Logfile = "filename.xls"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=CurDir() & "\" & Logfile,
ConflictResolution:=xlLocalSessionChanges
Application.DisplayAlerts = True

How do you know which default (yes|no) is taken to the overwrite message?
I assume from all the posts I have seen on this topic that the "yes"

default
is taken, but what if you wanted the "no" option taken?

The parm for "ConflictResolution" seems like that should handle it, but

the
options shown in the help files do not cover this.

--
Regards,
John



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
Copying defaults Dudley Excel Discussion (Misc queries) 3 March 27th 09 02:34 PM
Format Defaults Crist Excel Discussion (Misc queries) 4 October 19th 06 03:09 PM
Footer Defaults pthizzle Excel Discussion (Misc queries) 0 April 19th 06 02:17 PM
Set Defaults Erika Charts and Charting in Excel 0 October 4th 05 07:49 PM
Footer defaults Joe S. Excel Discussion (Misc queries) 4 December 9th 04 10:00 PM


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