Private Sub Workbook_BeforeClose(Cancel As Boolean)
Macro1
End Sub
'*********************************
Sub Macro1()
ChDir [B5]
ActiveWorkbook.SaveAs Filename:= _
[B5] & [D5], FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub
1)正手手动建宽判立文件举巧嫌 d:\1234.xls,试试是否有权限的限制。
2) 检查你B5内的路径格式,例如 d:\
检查你E5内的文件名,例如 123(或123.xls) 不能有非法字符