Hi Deko,
But I'm using automation (from Access) and it's not working:
sn = 'Year 2004_0'
lr = xlapp.Workbooks(strXlsFile).Worksheets(sn) _
.Range("A1").SpecialCells(xlCellTypeLastCell).Row
Make that:
sn = "Year 2004_0"
When using the Worksheets collection from VBA, the single quotes are
not needed.
Regards,
Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com