G
Greg Maxey
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)
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)