select non-blank cells in excel via ADO

SeanO
10-25-2004, 08:23 AM
I'm trying to query an excel spreadsheet for a list of products but when i run across a blank cell the record set spits out an illegal use of null error. Any one know a work around?

Second, I understand SQL reasonably well yet the syntax for excel SQL is a bit lacking in its robust functionality, I don't really expect anything different. I get the named ranges and even unnamed ranges but is there a way to use WHERE or any other clauses?

Dennis DVR
10-25-2004, 09:19 AM
I'm trying to query an excel spreadsheet for a list of products but when i run across a blank cell the record set spits out an illegal use of null error. Any one know a work around?

Second, I understand SQL reasonably well yet the syntax for excel SQL is a bit lacking in its robust functionality, I don't really expect anything different. I get the named ranges and even unnamed ranges but is there a way to use WHERE or any other clauses?

As for your first question, if you are retrieving a value from a cell, then you might want to add an empty string before getting the values from the excel sheet cell i.e.

Dim myValue As String
myValue = "" & oWorkSheet.Cells(4, 1).Value

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum