Save as dialog

D

David T

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????
 
M

Mike H

David,

Maybe:-

Sub sonic()
'Your code
Dim FileName As String
FileName = Application.GetSaveAsFilename
If FileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs FileName
End Sub
 
P

papou

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

HTH
Cordially
Pascal
 
D

David T

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
 
R

Ron de Bruin

Suggestion

Change

"False" to False

If your code is running on a non English machine "False" is not working
 
D

Dave Peterson

And remember to also change:
Dim FileName As String
to
Dim FileName As Variant 'could be a string or a boolean
 
Top