|
Private Sub 另存为发送表格()
Dim VBC As Object, SHP As Shape, S$, SH As Worksheet
S = ThisWorkbook.Path & "\" & Replace(ThisWorkbook.Name, ".xlsm", "") & "-发送.xlsm"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ThisWorkbook.SaveCopyAs S
With Workbooks.Open(S)
For Each SH In .Sheets
For Each SHP In SH.Shapes
SHP.Delete
Next
Next
For Each VBC In ActiveWorkbook.VBProject.VBComponents
With Application.VBE.ActiveVBProject.VBComponents
.Remove .Item(VBC.Name) '删除模块、类模块、窗体
End With
Next
.Close True
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "备份完毕"
End Sub
以上是zhaogang1960版主之前写的代码,这为啥报错了呢
|
|