Good morning Gents.
The following macro attempts to open a new file, take the name of a already opened file and then, save the new file with a variation of the existing file name.
==============================
Private Sub CmdB_Invoice_New_Click()
CurrentfileName = ActiveWorkbook.Name
NewFileName = "DraftInvoice_" & Left(CurrentfileName, Len(CurrentfileName) - 5) & "_" & Format(Now, "yyyy_mm_dd")
'Debug.Print NewFileName
Set newbook = Workbooks.Add
With newbook
.Title = "RGH Invoicing"
SaveTheNewFile = Application.GetSaveAsFilename(InitialFileName:=NewFileName, FileFilter:="Excel Files (*.xlsx), *.xlsx", Title:="RGH Save As")
End With
End Sub
========================================
Somehow, Though the save as dialog box is opened with the proper information, after clicking on the "Save" button, nothing happens
The following macro attempts to open a new file, take the name of a already opened file and then, save the new file with a variation of the existing file name.
==============================
Private Sub CmdB_Invoice_New_Click()
CurrentfileName = ActiveWorkbook.Name
NewFileName = "DraftInvoice_" & Left(CurrentfileName, Len(CurrentfileName) - 5) & "_" & Format(Now, "yyyy_mm_dd")
'Debug.Print NewFileName
Set newbook = Workbooks.Add
With newbook
.Title = "RGH Invoicing"
SaveTheNewFile = Application.GetSaveAsFilename(InitialFileName:=NewFileName, FileFilter:="Excel Files (*.xlsx), *.xlsx", Title:="RGH Save As")
End With
End Sub
========================================
Somehow, Though the save as dialog box is opened with the proper information, after clicking on the "Save" button, nothing happens