我发送了一个.xls文件以在我的宏中使用。 .xls文件的问题在于它们无法处理运行我的宏所需的行数。因此,为了解决这个问题,我试图首先保存我作为.xlsx文件发送的文件,然后按照计划继续使用宏。不幸的是,一旦我达到 APPSInvoiceWB = Workbooks.Open(APPSInvoiceFN & "x")
我收到一个错误:对象需要。我的代码有什么问题?我是否正在采取最佳方法解决我的.xls问题?需要将xls文件保存为xlsx,关闭然后重新打开它
MsgBox "Please select APPS Invoice file"
APPSInvoiceFN = Application.GetOpenFilename'
If APPSInvoiceFN = False Then ' User Pressed Cancel
MsgBox "APPS Invoice file not selected. APPS invoice will not be updated."
Application.ScreenUpdating = True
Exit Sub
Else
On Error GoTo ErrHandler
Set APPSInvoiceWB = Workbooks.Open(APPSInvoiceFN)
On Error GoTo 0
APPSInvoiceWB.SaveAs FileFormat:=51
APPSInvoiceWB.Close savechanges:=True
APPSInvoiceWB = Workbooks.Open(APPSInvoiceFN & "x")