I am able to duplicate a workbook (copy to a desired location) which contains a macro in the background. This duplicate copy also contains the same macro. My Problem is I do not want this duplicate workbook to have a macro with it. Can anyone tell how to do it?
Thank you in advance!!!
Open both the workbook that contains the macro you want to copy, and the workbook where you want to copy it. On the Developer tab, click Visual Basic to open the Visual Basic Editor. , or press CTRL+R . In the Project Explorer pane, drag the module containing the macro you want to copy to the destination workbook.
On the Developer tab, click Record Macro. In the Record Macro dialog box, type a meaningful name for the macro in the Macro name box. Make sure you don't use any spaces in the name. In the Store macro in box, select Personal Macro Workbook.
Save your workbook as macro-free, i.e. simply as Excel Workbook. For my Excel 2007 this is done using:
Application.DisplayAlerts = False
ThisWorkbook.CheckCompatibility = False
ThisWorkbook.SaveAs Filename:="D:\DOCUMENTS\Book1.xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Application.DisplayAlerts = True
Correct path & name as you wish.
Read more about SaveAs
method: http://msdn.microsoft.com/en-us/library/office/ff841185%28v=office.14%29.aspx
...and available File Formats: http://msdn.microsoft.com/en-us/library/office/ff198017%28v=office.14%29.aspx
Hope that was helpful)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With