View Full Version : Excel pulls in 0 instead of null


BigJimSlade
12-24-2002, 08:08 AM
Hi, Big Jim here:


************
(some code ommitted)

Dim sht As Excel.Worksheet
Dim wkb As Excel.Workbook

PreSale(i).RFPLogin = sht.Cells(1, 1)

************

In cell (1,1), there is a null value. However, when I run the above line, Presale(i).RFPLogin becomes = 0 as opposed to null. When I look at the value of sht.Cells(1,1) in break mode, the value is also 0 as opposed to null.

I have gone back into the spreadsheet and replaced the null with other things, such as text, and the text imports fine, but I need the null value. What should I do?

Thanks in advance...

Big Jim

Ironis
12-26-2002, 07:05 AM
Oke, I'm quite new to this and trying to learn by helping other people, but couldn't you use a statement like:

If IsNull(sht.Cells(1,1)) or sht.Cells(1,1) = "" then
Presale(i).RFPLogin = Null
End If

Maybe you could try when sht.cells(1,1) = 0 then ...

Just a thought, if this doesn't work I have learned something again :)

Ironis :cool:

BigJimSlade
12-26-2002, 09:38 PM
Ironis,

I appreciate your help....unfortunately, referencing the cell is the problem. When the value of the cell is NULL, it returns 0.

Thanks for responding!

Big Jim