chirayu
Well-Known Member
Hi guys,
Firstly I don't get any errors. Secondly my file doesn't actually save. Unsure what I'm doing wrong here.
Firstly I don't get any errors. Secondly my file doesn't actually save. Unsure what I'm doing wrong here.
Code:
Sub SaveThisFile()
Dim Macrofile, MyFile, MyPath As String
Macrofile = ActiveWorkbook.Name
MyFile = "BKG " & Format(Now, "DD-MMM-YYYY HH:MM:SS")
Range("E2").Value = MyFile
Worksheets(Array("MAIN", "DATA", "RATES")).Copy
ActiveSheet.Shapes("Button 1").Delete
ActiveSheet.Shapes("Button 2").Delete
Range("I2:I3").ClearContents
With Application.FileDialog(msoFileDialogSaveAs)
.InitialFileName = MyFile & ".xlsx"
.FilterIndex = 1
.Show
End With
Windows(Macrofile).Activate
MsgBox "File Saved", vbInformation, ""
End Sub