-2

I am using a macro that runs automatically when opening my file, which includes a "SaveAs" function. However, I would like the original file to stay open after saving in case I need to double check the data or want to make a change. I have read that people suggest the use of the "SaveAsCopy" function, however, I need to save it as an .XLXS and not an .XLSM file, which "SaveAsCopy" doesn't seem to have the ability to do.

Any help would be appreciated!

BigBen
  • 46,229
  • 7
  • 24
  • 40

1 Answers1

0

Does this work:

Sub SaveWorkbook()

Dim wb, wbnew As Workbook
Dim FileName As String
Dim FilePath As String

Application.DisplayAlerts = False

Set wb = ThisWorkbook

FilePath = "C:\" 'Your File Path
FileName = "Saved File" 'Your File Name

wb.Activate

'Copies sheets to new workbook
ActiveWorkbook.Sheets.Copy
 
Application.Dialogs(xlDialogSaveAs).Show FilePath & FileName

'OR alternatively
'ActiveWorkbook.SaveAs FileName:=FilePath & FileName & ".xlsx"

ActiveWorkbook.Close

Application.DisplayAlerts = True

End Sub
steveP
  • 79
  • 7