Save as dialog

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro on an Activeworkbook that opens a specifice file in my C:
drive and copies data from the activeworkbook into the workbook in my C:
drive. When my active workbook copies the data to the file, I would like the
file to prompt the SaveAs dialog box.


Can anyone help????
 
David,

Maybe:-

Sub sonic()
'Your code
Dim FileName As String
FileName = Application.GetSaveAsFilename
If FileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs FileName
End Sub
 
Hello David
See VBA help on either:
Application.Dialogs(xlDialogSaveAs).Show
or
Application.GetSaveAsFilename

HTH
Cordially
Pascal
 
thanks very much. the code works great!

papou said:
Hello David
See VBA help on either:
Application.Dialogs(xlDialogSaveAs).Show
or
Application.GetSaveAsFilename

HTH
Cordially
Pascal
 
Suggestion

Change

"False" to False

If your code is running on a non English machine "False" is not working
 
And remember to also change:
Dim FileName As String
to
Dim FileName As Variant 'could be a string or a boolean
 
Back
Top