将包含宏的工作簿复制到没有宏的工作簿

时间:2021-09-09 00:54:36

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!!!

提前谢谢你! ! !

1 个解决方案

#1


12  

Save your workbook as macro-free, i.e. simply as Excel Workbook. For my Excel 2007 this is done using:

将您的工作簿保存为无宏,也就是说,保存为Excel工作簿。对于我的Excel 2007,这是使用:

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

阅读更多关于SaveAs方法的文章:http://msdn.microsoft.com/en-us/library/office/ff841185%28v=office.14%29.aspx…以及可用的文件格式:http://msdn.microsoft.com/en-us/library/office/ff198017%28v=office.14%29.aspx

Hope that was helpful)

希望是有帮助的)

#1


12  

Save your workbook as macro-free, i.e. simply as Excel Workbook. For my Excel 2007 this is done using:

将您的工作簿保存为无宏,也就是说,保存为Excel工作簿。对于我的Excel 2007,这是使用:

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

阅读更多关于SaveAs方法的文章:http://msdn.microsoft.com/en-us/library/office/ff841185%28v=office.14%29.aspx…以及可用的文件格式:http://msdn.microsoft.com/en-us/library/office/ff198017%28v=office.14%29.aspx

Hope that was helpful)

希望是有帮助的)