i sent .xls file work in macro. problem .xls files can't handle number of rows need run macro. so, in order work around it, trying first save file sent .xlsx file , continue on macro planned. unfortunately, once reach appsinvoicewb = workbooks.open(appsinvoicefn & "x")
error: object required. wrong code? taking best approach solve .xls problem?
msgbox "please select apps invoice file" appsinvoicefn = application.getopenfilename' if appsinvoicefn = false ' user pressed cancel msgbox "apps invoice file not selected. apps invoice not 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")
you forgot set
keyword on last line:
set appsinvoicewb = workbooks.open(appsinvoicefn & "x")
as far approach goes... method in general should work fine convert format.
Comments
Post a Comment