发布网友 发布时间:2024-10-18 22:32
共3个回答
热心网友 时间:2024-11-07 07:36
不知道是不是这个意思:在Excel的ThisWorkbook模块中,粘贴下列代码。
Private Sub Workbook_BeforeClose(Cancel As Boolean)热心网友 时间:2024-11-07 07:35
excel自动另存需要编写宏函数。
可以在ThisWorkBook对象中输入代码完成,
代码如下:
Private Sub Workbook_BeforeClose(Cancel As Boolean) ActiveWorkbook.SaveAs Filename:="C:\aaa.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub
其中C:\aaa.xls就是所备份的文件的路径。
热心网友 时间:2024-11-07 07:32
本例假设文件另存为:C:\aaa.xls,你可以自行修改
请在ThisWorkBook对象中输入如下代码:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.SaveAs Filename:="C:\aaa.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub