Can anyopne help me figure out how to edit a VBA project's code with code? Specifically, I want to delete all procedures in a sheet's code module by means of a VBA procedure in the same project.
Background: one sheet contains a pivot table. The sheet's code module contains a small procedure to refresh the pivot cache on sheet activate event and the procedure calls a number of preparatory procedures located in a standard module. But, I need to extract the sheet alone (i.e. without the sheet containing the database) to a new workbook to email a customer. Since only the sheet is saved in the new workbook and without the project's standard modules, the activate procedure cannot find the preparatory procedures so bugs.
I need to automate the extraction of the pivot table sheet to a new workbook also deleting the VBA code in the sheet's code module.
Thanks for any help.
Background: one sheet contains a pivot table. The sheet's code module contains a small procedure to refresh the pivot cache on sheet activate event and the procedure calls a number of preparatory procedures located in a standard module. But, I need to extract the sheet alone (i.e. without the sheet containing the database) to a new workbook to email a customer. Since only the sheet is saved in the new workbook and without the project's standard modules, the activate procedure cannot find the preparatory procedures so bugs.
I need to automate the extraction of the pivot table sheet to a new workbook also deleting the VBA code in the sheet's code module.
Thanks for any help.