Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Excel 2003 opening Excel 2007 file with Workbooks.Open method in VBA

I'm on Excel 2003, with a converted 2007 excel file. I'm trying to loop through 3 files in the same folder and open them, however, I get an error:

"Excel cannot open the file biz1.xlsm because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.".

I Googled and found potential results with the Converter factor in Workbooks.Open method, I tried 0,1, and 2 for a parameter but those did not work.

Const numfile = 3
dim f as String
For i = 1 to numfile
f = ActiveWorkbook.Path & Application.PathSeparator & "biz" & i & ".xlsm"
Workbooks.Open f
Next i

Comments