Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Sally
 
Posts: n/a
Default FILE 'SAVE AS' IN VBA CODE

Hi,
Please can someone tell me the VBA code to prompt a user to 'save as' a file
in excel. the folders will have to be specified...
--
Thanks
Sally
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default FILE 'SAVE AS' IN VBA CODE

Look at GetSaveAsFilename in VBA help.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Sally" wrote in message
...
Hi,
Please can someone tell me the VBA code to prompt a user to 'save as' a

file
in excel. the folders will have to be specified...
--
Thanks
Sally



  #3   Report Post  
Posted to microsoft.public.excel.misc
JLatham
 
Posts: n/a
Default FILE 'SAVE AS' IN VBA CODE

Something similar to this should work

Sub FileSaveAsCode()

Dim fName As Variant

fName = Application.GetSaveAsFilename( _
fileFilter:="Excel Workbooks (*.xls), *.xls")
If fName = "" Then ' user [Cancel]ed
Exit Sub
End If

On Error Resume Next
ActiveWorkbook.SaveAs Filename:=fName
If Err < 0 Then
'user probably cancelled at this point
'as when notified of existing file of same name
'you can either test for errors
'or simply ignore them
Err.Clear
End If
On Error GoTo 0 ' clear error trapping
End Sub

"Sally" wrote:

Hi,
Please can someone tell me the VBA code to prompt a user to 'save as' a file
in excel. the folders will have to be specified...
--
Thanks
Sally

  #4   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default FILE 'SAVE AS' IN VBA CODE

Try code like

Dim FName As Variant
FName = Application.GetSaveAsFilename(ThisWorkbook.Name, "Excel
Files (*.xls),*.xls")
If FName = False Then
MsgBox "User Clicked Cancel"
Else
ThisWorkbook.SaveAs Filename:=FName
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Sally" wrote in message
...
Hi,
Please can someone tell me the VBA code to prompt a user to
'save as' a file
in excel. the folders will have to be specified...
--
Thanks
Sally



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
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
Excel XP: File name in Title Bar not changed after Save As... Dominic Excel Discussion (Misc queries) 9 August 1st 05 12:58 PM
save excel file from a table delimited file (.txt) using macros sedamfo New Users to Excel 1 February 15th 05 04:19 AM
How do you disable save file dialog? someone Setting up and Configuration of Excel 2 February 13th 05 12:02 AM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


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