如何在保持最初打开的工作簿打开的同时将打开的工作簿导出到新工作簿?我相信这与我使用.saveAs函数有关,是否有另一种导出工作簿的方法,以便我可以保持原始工作簿打开?
Sub exportXLS()
Dim MyPath As String
Dim MyFileName As String
answer = MsgBox("Do you want to export to Excel?", vbYesNo + vbQuestion, "Export to Excel")
If answer = vbYes Then
Call reportR
Call reportS
Sheet27.Calculate
MyFileName = Application.GetSaveAsFilename(Year(Now()) & " - " & Format(Month(Now()), "00"), "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm", , "Save As XLSM file")
If MyFileName <> "False" Then
ActiveWorkbook.SaveAs Filename:=MyFileName, FileFormat:=xlOpenXMLWorkbookMacroEnabled
End If
End If
end sub()