Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel returns blank values using ADO/VB

Hi guys,

I have a big spreadsheet and I have written some VB code
that reads the spreadsheet using ADO. The range that I am
reading, has numeric values. The cells in the first row
have Numeric Format and the rest of the cells in the
second row onwards, have a Custom Format of '[=0]"";0'
which means 'if the value is 0, then just return blank
string ("") else return the value with a precision of one
decimal place'.
The ADO/VB returns the correct values for the first row
but for some of the rest of the rows, esp. for the second
row, it returns Blank string (Not Null, though) even if
there is some value in the cell.
One more thing, if I change the Format of the cells with
Custom format to Numeric/General format, the ADO returns
correct results.
I am aware of a bug in the ADO that Excel returns Null
values when there is data type mismatch, but I had faced
that issue in the same spreadsheet but in a different
range. And I have already fixed that issue using the
workaround suggested by Microsoft, using "IMEX=1". That
range is fixed. I do not think it is the same issue as ADO
does not return Null values but a blank string.

Also, if I use ODBC-Excel driver instead of ADO, then it
does return me correct results but the problem with that
is there is known bug, without a workaround to date, with
ODBC that it always assumes that the first row has column
headers and hence ignores the first row. Microsoft
suggests to use ADO instead of ODBC if first row does not
contain headers. Also, I'll need to make a lot of changes
and test it, to switch to ODBC instead of ADO as I have
been using ADO for long time.

Now, I am wondering if there is anything that I could do
without making any changes to the spreadsheet so that ADO
returns me the correct values.

Guys, I would really appreciate your help.

Cheers
Manish

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula returns blank cells--only want values to show Wilma Excel Worksheet Functions 3 July 14th 09 04:02 PM
sumif returns blank if all cells blank Heliocracy Excel Worksheet Functions 7 January 19th 09 08:59 PM
Opening an excel file returns a blank worksheet JVenner Excel Discussion (Misc queries) 4 October 15th 06 02:27 AM
When i try to filter information, excel returns a blank page? AJoudrie Excel Worksheet Functions 2 April 5th 06 09:37 PM
Using Jet to read excel file returns blank for last cell - sometim Ron Excel Discussion (Misc queries) 1 December 9th 04 08:21 AM


All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"