thisworkbook,代碼:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Dim mypath As String, fname As String
fname = "自動備份" & Format(Date, "yymmdd") & ".xlsx"
mypath = ThisWorkbook.Path & "/備份/"
ThisWorkbook.SaveCopyAs mypath & fname
End Sub作者: lpk187 時間: 2016-8-20 14:17