LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default SaveAs Dialog box

Hi Daniel

Another way:

Sub SaveFileCode()
Dim vF As Variant
Dim sFil As String
Dim ForcedName As String

ForcedName = "XYZ.xls"

vF = Application.GetSaveAsFilename(ForcedName, _
"Excel workbook (*.xls), *.xls")
If vF = False Then Exit Sub
sFil = CStr(vF)
If Right$(sFil, Len(ForcedName) + 1) < "\" & ForcedName Then _
sFil = Left$(sFil, InStrRev(sFil, "\")) & ForcedName

MsgBox "User chose " & sFil & _
". This code did not save the file"

If Dir(sFil) < "" Then MsgBox "btw " & sFil & _
" already exists. Ask to overwrite."

End Sub

HTH. Best wishes Harald

"Daniel Bonallack" skrev i
melding ...
I want to direct the user to save the file as a certain name, but the user
should to be able to browse the directory and choose where to save it.

For example, I want the user to have to save the file as "XYZ.xls". Can
someone provide the code that allows freedom on the save path, but not on

the
file name?

Thanks in advance
Daniel Bonallack



 
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
SaveAs dialog Gary''s Student Excel Discussion (Misc queries) 2 February 23rd 06 03:11 PM
Supress SaveAs dialog box? Ed Excel Programming 4 March 11th 05 02:20 AM
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 05:35 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"