"Steve" <so***@private.emailaddresswrote in message
news:mV*****************@newsread1.news.pas.earthl ink.net...
Look at the Transferspreadsheet function in the Help file for retrieving
data from Excel.
Absolute drivel. TransferSpreadsheet is a method and not a function but
won't do what the OP wants anyway. Please stop posting this kind of crap
just to get your sig line aired. On second thoughts, keep posting ... it
shows the whole community that you haven't a clue.
To the OP:
You need to declare the workbook and each sheet as objects then use code to
interrogate them. Here's a code extract from one of my apps which should
get you started.
Keith.
www.keithwilby.com
Sub test()
Dim objXL As Excel.Application
Dim objWkb As Excel.Workbook
Dim objSht As Excel.Worksheet
Dim objRange As Excel.Range
Set objXL = New Excel.Application
Set objWkb = objXL.Workbooks.Open("C:\ExcelData\JulyFile1.xls")
Set objWkb = objXL.ActiveWorkbook
objXL.Visible = False
Set objSht = objWkb.Sheets(1)
Debug.Print objSht.Name
Set objRange = objSht.Range("A1").CurrentRegion
Debug.Print objRange.Columns.Count
objXL.Quit
Set objSht = Nothing
Set objWkb = Nothing
Set objXL = Nothing
End Sub