Thread: Save As Dialog
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arne[_2_] Arne[_2_] is offline
external usenet poster
 
Posts: 21
Default 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