这是我的代码:
'Test: Is the file exists?
Dim CW_ExportFilePathAndName As String
CW_ExportFilePathAndName = FilePathForSave & CW_NameSaveFile
If Dir(CW_ExportFilePathAndName) <> "" Then
Dim InitialName As String
Dim sFileSaveName As Variant
InitialName = CW_ExportFilePathAndName
sFileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitialName, fileFilter:="Excel Files (*.xlsm), *.xlsm")
If sFileSaveName <> False Then
ActiveWorkbook.SaveCopyAs sFileSaveName
MsgBox "The source file is saved on an individual name!"
Else
MsgBox "The source file is not saved!"
End If
Else
ActiveWorkbook.SaveCopyAs CW_ExportFilePathAndName
End If
答案 0 :(得分:0)
解决方法:SaveAs可以使用URL。只有重新开放才能解决!