Sid.  T.
Sid. T.

Reputation: 93

Save As not saving a file

I'm trying to get the 'Save As' dialogue to prompt with the inputted information on a userform and save as a new file. Everything looks like it works and even has the saving/loading icon when I click 'save' but no actual saved file is saved in my folder. Here is my 'Save As' code:

Dim IntialName As String
Dim fileSaveName As Variant
InitialName = Range("d1") & "_" & Range("j1") & "_" & Range("p1")
fileSaveName = Application.GetSaveAsFileName(InitialFileName:=InitialName, _
    fileFilter:="Excel Macro-Enabled Workbook (*.xlsm), *.xlsm") 

Upvotes: 1

Views: 82

Answers (1)

braX
braX

Reputation: 11735

Add

ActiveWorkbook.SaveAs fileSaveName, xlFileFormat.xlOpenXMLWorkbookMacroEnabled

after your code to actually save it.

All your code currently does is give you a string so you can save it using that name. You have to do the actual saving yourself.

Upvotes: 2

Related Questions