给你简单示例:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim xl As New Excel.Application Dim xlBook As Workbook
Set xl = GetObject(, "Excel.Application")
Set xlBook = xl.ActiveWorkbook
FN1 = xlBook.Name & CStr(Year(Date))
ActiveWorkbook.SaveCopyAs "D:/" & FN1 & ".xls"
End Sub
有两个问题你自己很容易解决了
一是截取原来文件的文件名,即从“客户信息记录2013-4-1”这名字中取出前一部分
二是注意日期格式,因为可能你系统的日期格式是2013/4/1,斜杠/文件名中不可用,你得检测并转换