Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using this to run macros before and after a save event. Save &
SaveAs do the same thing. Can I have a second routine that does a Save without asking for file and permission to overwrite? SaveAs would be as below. TIA ____________________________________________ Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _ Cancel As Boolean) On Error GoTo PrintingOver Application.EnableEvents = False Call Workbook_2 Dim varResponse As Variant varResponse = Application.GetSaveAsFilename( _ FileFilter:="Microsoft Excel Workbook (*.xls), *.xls") If varResponse = False Then 'do nothing except exit ElseIf varResponse = Me.FullName Then MsgBox "Please save under a different name. " Else ThisWorkbook.SaveAs varResponse End If Call Workbook_2 PrintingOver: Application.EnableEvents = True Cancel = True End Sub ----------- by Jim Cone |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Improve method of calling a private function in a private module | Excel Programming | |||
re : Possible to run private sub macros by writing another private | Excel Programming | |||
Private Sub Running Other Private Sub Inadvertently | Excel Programming | |||
Workbook_BeforeSave | Excel Programming | |||
Workbook_BeforeSave() in xla | Excel Programming |