我想问一下如何消除此错误通知?请看所附图片。
我正在使用此VBA代码:
Sub Sample()
'~~> Change Sheet1 to the relevant sheet
'~~> This will create a new workbook with the relevant sheet
ThisWorkbook.Sheets("Fuels_Slips_Issued").Copy
'~~> Save the new workbook
ActiveWorkbook.SaveAs "C:\book1.xlm", FileFormat:=xlOpenXMLWorkbook
End Sub
答案 0 :(得分:1)
XLM不是FileFormat:= xlOpenXMLWorkbook。忽略扩展名,并让FileFormat参数添加正确的扩展名。
ActiveWorkbook.SaveAs Filename:="C:\book1", FileFormat:=xlOpenXMLWorkbook 'XLSX type
有关FileFormat类型的完整列表,请参见xlFileFormat enumeration。