Hi,
I'm trying to remove the macros from a specific worksheet. My idea was to just save it as an xlsx file then move that sheet to where I wanted it. The method works in that it removes the Module1 code, but it doesn't remove the code that I have attached to the actual worksheet, (i.e. when in VB editor, double click on the worksheet and the code in there). Does anyone know of a way to remove this code as well without having to enable the Microsoft Visual Basic for Applications Extensibility?
I've looked through lots of forums and different tips from excel sites but they either require the above reference to be enabled or say to use fileformat:=51 which doesn't remove the code from the sheet, only the module.
Here is my code;
I'm trying to remove the macros from a specific worksheet. My idea was to just save it as an xlsx file then move that sheet to where I wanted it. The method works in that it removes the Module1 code, but it doesn't remove the code that I have attached to the actual worksheet, (i.e. when in VB editor, double click on the worksheet and the code in there). Does anyone know of a way to remove this code as well without having to enable the Microsoft Visual Basic for Applications Extensibility?
I've looked through lots of forums and different tips from excel sites but they either require the above reference to be enabled or say to use fileformat:=51 which doesn't remove the code from the sheet, only the module.
Here is my code;
Code:
Sub Stupid_saving()
Application.ScreenUpdating = False
Dim temp_wbk As Workbook
Dim source_wbk As Workbook
Set source_wbk = ActiveWorkbook
Workbooks.Add
Set temp_wbk = ActiveWorkbook
source_wbk.Sheets("Activities").Copy after:=temp_wbk.Sheets(Sheets.Count)
temp_wbk.SaveAs Filename:="W:\NOMACRO.xlsx", FileFormat:=51
Application.ScreenUpdating = True
End Sub