Greetings,
I am using the snippet of code below in a larger macro to copy a WS to another file location in order to create a backup copy, and that part works fine. But now I added a couple of buttons to the original WS so the users could run some macros, so now the WS copy is also getting those buttons included. Is there a way to tweak the code so it only copies over the data and not those buttons? I would typically just use a "pastespecial" method but I am using save instead of paste. (I don't see any reference to a "saveas special" in my searches) I appreciate any thoughts
I am using the snippet of code below in a larger macro to copy a WS to another file location in order to create a backup copy, and that part works fine. But now I added a couple of buttons to the original WS so the users could run some macros, so now the WS copy is also getting those buttons included. Is there a way to tweak the code so it only copies over the data and not those buttons? I would typically just use a "pastespecial" method but I am using save instead of paste. (I don't see any reference to a "saveas special" in my searches) I appreciate any thoughts
VBA Code:
Worksheets("Inspection Log").Activate
Application.EnableEvents = False
Sheets("Emergency Light Report").Copy
Set wb = ActiveWorkbook
With wb
Application.DisplayAlerts = False
.SaveAs _
"\\MESSDV002.na.infineon.com\Facilities\DeptData\EH&S\Compliance and EHS\Facilities Inspections\Emergency Lighting\Emergency Lighting Inspection Report " _
& Format(Now, "yy_mmdd") & ".xlsx", FileFormat:=51
.Close True
Application.DisplayAlerts = True
End With