Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Option to overwrite with VBA initiated open/Save Common Dialog

The way I read your post is that you do want to see the overwrite
message, correct? If so, simply remove the DisplayAlerts lines from
Chip's code.
Sub AAA()
Dim FName As Variant
FName = Application.GetSaveAsFilename( _
filefilter:="Excel Files (*.xls), *.xls")
If FName = False Then
' user cancelled
Exit Sub
End If
On Error Resume Next
ThisWorkbook.SaveAs Filename:=FName
End Sub

BAC wrote:
XP, MSO 2003
I have an Excel routine that executes a call to the comon dialog open/save
file as per http://www.mvps.org/access/api/index.html Call Windows File
Open/Save Dialog box.

The only issue i have is, when saving, there is no option to overwrite.
(i.e. "The file filename.xls already exists, do you want to overwrite it?"
type-thing)

Is it possible to do that within the call to the dialog box, or does that
have to be coded as a separate search for the file and, if it's found use a
message box to ask, then call the dialog box.

I was told using DisplayAlert before the call would work but it doesn't.

TIA

BAC


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Option to overwrite with VBA initiated open/Save Common Dialog

The way I read your post is that you do want to see the overwrite
message, correct? If so, simply remove the DisplayAlerts lines from


I think you're right. I misread the post and thought he wanted to suppress
the overwrite? message.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"JW" wrote in message
ps.com...
The way I read your post is that you do want to see the overwrite
message, correct? If so, simply remove the DisplayAlerts lines from
Chip's code.
Sub AAA()
Dim FName As Variant
FName = Application.GetSaveAsFilename( _
filefilter:="Excel Files (*.xls), *.xls")
If FName = False Then
' user cancelled
Exit Sub
End If
On Error Resume Next
ThisWorkbook.SaveAs Filename:=FName
End Sub

BAC wrote:
XP, MSO 2003
I have an Excel routine that executes a call to the comon dialog
open/save
file as per http://www.mvps.org/access/api/index.html Call Windows File
Open/Save Dialog box.

The only issue i have is, when saving, there is no option to overwrite.
(i.e. "The file filename.xls already exists, do you want to overwrite
it?"
type-thing)

Is it possible to do that within the call to the dialog box, or does that
have to be coded as a separate search for the file and, if it's found use
a
message box to ask, then call the dialog box.

I was told using DisplayAlert before the call would work but it doesn't.

TIA

BAC



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
Option to overwrite with VBA initiated open/Save Common Dialog Chip Pearson Excel Programming 0 October 12th 07 06:00 PM
How do you turn off "Save a copy/Overwrite changes" dialog box Nicko Excel Discussion (Misc queries) 4 December 8th 05 05:22 PM
Save a Copy/Overwrite changes dialog box TPenner Excel Discussion (Misc queries) 1 January 7th 05 08:56 PM
Save a Copy/Overwrite changes dialog box TPenner Excel Worksheet Functions 0 January 7th 05 05:03 PM
Hyperlink to open a common dialog on a msgbox Harinath Excel Programming 1 April 28th 04 03:33 PM


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