• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

msoFileDialogSaveAs issue

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.

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
 
Back
Top