ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save As Dialog (https://www.excelbanter.com/excel-programming/271148-save-dialog.html)

Arne[_2_]

Save As Dialog
 
maybe something like this is of help: in the event
Workbook_BeforeSave (in the 'module' MS Excel
ObjectsThisWorkbook)

Private Sub Workbook_BeforeSave(ByVal SaveAsUi As Boolean,
Cancel As Boolean)


Dim NewFileName as Sring

'Avoid the event from being fired by its own contents
Application.EnableEvents = False

'Suppose cell A1 contains the desired file name
NewFileName= Cells("A1").Text

' Arguments: document_text, type_num, prot_pwd, backup,
' write_res_pwd, read_only_rec
Application.Dialogs(xlDialogSaveAs).Show NewFileName, _
1, "", False, "", False

'Re-enable events or you'll be in trouble later
Application.EnableEvents = True

Cancel= True

End Sub

HTH, Arne



All times are GMT +1. The time now is 12:07 AM.

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