ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving workbook from vba (https://www.excelbanter.com/excel-programming/284971-saving-workbook-vba.html)

Don[_12_]

Saving workbook from vba
 
I am wanting to save a workbook from a command button on
the first sheet. How can I bring up the save-as dialog
window in vba ? This can be used by anyone using the file
to save wherever he wishes with any file name.
Many thanks in advance for any assistance.


Patrick Moloy

Saving workbook from vba
 
Sub SaveTheFile()
Dim FN As String
FN = Application.GetSaveAsFilename()
If UCase(FN) = "FALSE" Then Exit Sub
ThisWorkbook.SaveAs FN
End Sub

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I am wanting to save a workbook from a command button on
the first sheet. How can I bring up the save-as dialog
window in vba ? This can be used by anyone using the

file
to save wherever he wishes with any file name.
Many thanks in advance for any assistance.

.



All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com