View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default ADO - recordset - closed excel workbook


..The OP stated:

€ś1. I know the path where the closed spreadsheet file lives
2. I know the sheet name and cell that i want to read into my
recordset€ť

strSQL1 polls a cell, and with the proper notation will poll any cell you
like, any column you like which by definition (€ś1 of 1€ť) would be the
majority data type.

But you know all this, so why not append or suggest ways to improve the
procedure or offer one of your own.

I merely offered a little plug and play code to get the OP who was trying to
learn to write to a closed workbook moving in the right direction.

You suggest to use my code he must adjust the Jet registry keys.
Who will do that?

€śdetails on the relevant registry settings and how you may change them in
your favor, see€ť

I abdicate to the readers.

TK


"Jamie Collins" wrote:

"TK" wrote ...

Jet will not return both strings and numbers
in the same recordset so use rs for one, rs1 for
the another.

Where did you get this idea? This is clearly incorrect.


My statement should have read: With the code Im posting I was
unable to return both numbers and text from the same column
so I simply sent a second query to the workbook.


I don't understand. Your second query references a second column i.e.

strSQL = "Select * from [Sheet1$B9:B20]"
strSQL1 = "Select * from [Sheet1$A9:A10]"


so it cannot achieve your stated goal of returning 'both numbers and
text from the same column'.

If you have numbers and text in your column but you are getting null
values, Jet may be determining the data type using the 'majority type'
of the rows scanned instead of all values being coerced as 'Text'. For
details on the relevant registry settings and how you may change them
in your favor, see:

http://www.dicks-blog.com/excel/2004...al_data_m.html

Jamie.

--