Hi,
I'm using the following code to save as macro enabled excel with initial filename in the Application.GetSaveAsFilename:
The problem is that we in most computers don't get the initial filename.
What to do?
I'm using the following code to save as macro enabled excel with initial filename in the Application.GetSaveAsFilename:
Code:
Private Sub LagreSomExcel_Click()
Dim fileSaveName As Variant
Prosjekt = Sheets("Forside").Range("E3").Value
Rapportnavn = Range("C2").Value
fileName = Prosjekt & "_" & Rapportnavn
fileSaveName = Application.GetSaveAsFilename(initialFilename:=fileName)
If VarType(fileSaveName) = vbBoolean Then Exit Sub
fileSaveName = Left(fileSaveName, Len(fileSaveName) - 1)
' Save as XLSM
Application.DisplayAlerts = True
ActiveWorkbook.SaveAs fileName:=fileSaveName & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
End Sub
The problem is that we in most computers don't get the initial filename.
What to do?