Hello everyone,
I have a timesheet that I need to send every month to my company. I also have to rename it with the current date (Year and Month) and add a code has shown below.
Off course, it's not right because it gives me an error when opening saying:
My question is, how can I save to xlsx file format and remove all macros from file.
Many thanks to all!
I have a timesheet that I need to send every month to my company. I also have to rename it with the current date (Year and Month) and add a code has shown below.
Off course, it's not right because it gives me an error when opening saying:
My question is, how can I save to xlsx file format and remove all macros from file.
VBA Code:
Sub SaveAsNew()
Dim dt As String, wbName As String
wbName = "_KT_TS_KT055I-Jorge Ramos"
dt = Format(CStr(Now), "YYYYMM")
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\TimeSheet\" & dt & wbName & ".xlsx"
End Sub
VBA Code:
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
If Success = True Then Call SaveAsNew
End Sub
Many thanks to all!