From: Helmut Meukel on
Greg,

I may be wrong with this, but I suspect DAO will not work with
the new file format of Excel 2007 and Excel 2010.
IIRC, when installing Access or VB6 + DAO you get asked
which istallable ISAM drivers to install: dbase, excel, ...
and which ODBC drivers.
M$ has abandoned DAO many years ago, I don't think they
provided new drivers with Office 2007 and 2010 for the new file
formats.

You could switch to ADO, but why do you use an external engine
at all? You can easily use excel's native functions and objects to access
the data in the spreadsheet.
You are running your code from inside Excel, aren't you?
Or is this code in a VB6 program or from Access?

Helmut.


"Greg Maxey" <gmaxey(a)mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> schrieb im Newsbeitrag
news:erPyzSH9KHA.508(a)TK2MSFTNGP06.phx.gbl...
>I would have expected the same, but changing xls to xlsx or xlsm and changing
>Excel 8.0 to Excel 12.0 generators errors. Either can not locate an
>installable ISAM or the data is in the wrong format.
>
>
> JLGWhiz wrote:
>> I suspect that changing these two elements of code to reflect the
>> correct file extension and Excel version would help.
>>
>> Files\DemoSpreadsheet.xls",
>> False, False, "Excel 8.0")
>>
>>
>>
>>
>>
>> "Greg Maxey" <gmaxey(a)mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> wrote in
>> message news:ObFm$I%238KHA.4600(a)TK2MSFTNGP02.phx.gbl...
>>> I have some code that gets data from an Excel 2003 spreadsheet to
>>> populate a listbox in a userform:
>>>
>>>
>>> Dim db As DAO.Database
>>> Dim rs As DAO.Recordset
>>> Set db = OpenDatabase("E:\My Documents\Excel
>>> Files\DemoSpreadsheet.xls", False, False, "Excel 8.0")
>>> Set rs = db.OpenRecordset("SELECT * FROM `mySSRange`")
>>> While Not rs.EOF
>>> Me.ListBox1.AddItem rs.Fields(0).Value
>>> rs.MoveNext
>>> Wend
>>> rs.Close
>>> db.Close
>>> Set rs = Nothing
>>> Set db = Nothing
>>>
>>> What do I need to do to modify this code to extract data from a
>>> Excel 2007 format file (xlsx or xlsm) and an Excel 2010 format file?
>>>
>>> Thanks.
>>>
>>> --
>>> Greg Maxey
>>>
>>> See my web site http://gregmaxey.mvps.org
>>> for an eclectic collection of Word Tips.
>>>
>>> Arrogance is a weed that grows mostly on a dunghill (Arabic proverb)
>
>