shoheiyuna
New Member
- Joined
- Dec 3, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hi, I would like to:
I've appended the code below. Appreciate if could point out what went wrong / and how to fix it. Thank you!
- SaveAs a current .xlsm file as .xlsx
- With the file name: yymmdd hhmm & "h" (e.g. 231204 1045h)
- In the same folder that the .xlsm file is in.
I've appended the code below. Appreciate if could point out what went wrong / and how to fix it. Thank you!
VBA Code:
Sub SaveFile()
'
' SaveFile Macro
'
Dim wb As Workbook
Set wb = Workbooks("Setup.xlsm")
Dim dt As String, wbName As String
dt =[COLOR=rgb(184, 49, 47)] Format(Now(), "yymmdd hhmm")[/COLOR]
wbName = "h"
Application.DisplayAlerts = False
ActiveWorkbook.CheckCompatibility = False
ActiveWorkbook.SaveAs Filename = ActiveWorkbook.Path & Application.PathSeparator & dt & wbName, 51
Application.DisplayAlerts = True
ActiveWorkbook.CheckCompatibility = True
End Sub