I have been running the same VB code for years and have not run into any errors where my macro enabled workbook performs a Save As, as a non-macro enabled workbook or xlsx.
Now I get the error, "VB projects and XLM Sheets cannot be saved in a macro-free workbook."
I cannot figure out what is causing the error.
Below is my code. Any help is appreciated as to why now I cannot save as and receive the error.
Now I get the error, "VB projects and XLM Sheets cannot be saved in a macro-free workbook."
I cannot figure out what is causing the error.
Below is my code. Any help is appreciated as to why now I cannot save as and receive the error.
VBA Code:
Sub UpdateOOR()
Application.DisplayAlerts = False
ActiveWorkbook.Worksheets("OOR").ListObjects("MTs_SG_OOR").QueryTable.Refresh BackgroundQuery:=False
Cells.Select
Cells.EntireRow.AutoFit
ActiveWorkbook.Save
For Each Shp In ActiveSheet.Shapes
Shp.Delete
Next Shp
Range("B:D").EntireColumn.Hidden = True
Range("I:I").EntireColumn.Hidden = True
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"P:\Customer New\SG\3009 SG (60000009ES) Plastic Fittings\7. Status Reports (SR)\Open Order Reports\2023\" & "SG Plastics OPEN ORDER REPORT " & Format(Now, "mm.dd.yy") & ".xlsx", FileFormat:=51
Application.DisplayAlerts = True
End Sub