Excel pulls in 0 instead of null (1 Viewer)

BigJimSlade

Registered User.
Local time
Today, 02:38
Joined
Oct 11, 2000
Messages
173
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

Learning Member...
Local time
Yesterday, 22:38
Joined
Oct 10, 2002
Messages
61
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

Registered User.
Local time
Today, 02:38
Joined
Oct 11, 2000
Messages
173
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
 

Users who are viewing this thread

Top Bottom