
November 20th, 2003, 04:31 AM
|
|
Junior Member
|
|
Join Date: Nov 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
VBScript/ADO/Excel - get only top left cell
I need to get the data out of the top left most cell in my excel spreadsheet using ADO.
(the cell is actually b3 - but all the others above are blank)
the problem seems to be that the top row is being imported as a header since the following returns the first cell
rsData.Fields(0).Name
and this returns the cell below (b4)
rsData.Fields(0).Value
I cant use the Name field to gat the data because the cell contains a long string and the name field is truncated at 20 characters or so... :-(
any advice greatly appreciated,
NGEddie
the code if its helpful
PHP Code:
Set rsData = CreateObject("ADODB.Recordset")
rsData.Open "SELECT * FROM [sheet1$b3:b4]", strConnectionString, adOpenStatic, adLockReadOnly, adCmdText
msgbox rsData.recordCount
msgbox rsData.Fields(0).Name ' shows truncated b3'
msgbox rsData.Fields(0).Value ' shows b4'
|