mscallisto
Technical User
When I click "save" I want to trigger some logic to "Save As a new name" plus
do some general cleanup on that new file.
When I click "save" I enter this code:
The call to Subroutine "Center" in turn calls Sub FileSave (below) that saves
the file thus triggering Workbook_BeforeSave again.
My " If CallStatus <> "Yes" Then logic (above), doesn't work and I'm guessing its
because CallStatus is not a global variable.
How can I do this?
do some general cleanup on that new file.
When I click "save" I enter this code:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If CallStatus <> "Yes" Then
CallStatus = "Yes"
Call Center
Else
CallStatus = "Yes"
End If
End Sub
The call to Subroutine "Center" in turn calls Sub FileSave (below) that saves
the file thus triggering Workbook_BeforeSave again.
My " If CallStatus <> "Yes" Then logic (above), doesn't work and I'm guessing its
because CallStatus is not a global variable.
How can I do this?
Code:
Sub FileSave()
SuggestedFN = "Price List " & Month(Date) & " " & Day(Date) & " " & Year(Date) & " at " & Mid(Time, 1, 2) & " " & Mid(Time, 4, 2) & " " & Mid(Time, 7, 5)
MyPathAndFile = Application.GetSaveAsFilename(SuggestedFN, "Excel Files(*.xls),*.xls")
ActiveWorkbook.SaveAs Filename:= _
MyPathAndFile, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub