Link to home
Start Free TrialLog in
Avatar of aspnet-scotland
aspnet-scotlandFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Microsoft VBScript runtime (0x800A005E) Invalid use of Null: 'cdbl'

Hi,

I receive the below error message on line 2 of the attached vb script code snippet:

Microsoft VBScript runtime (0x800A005E) Invalid use of Null: 'cdbl'

Do any experts know how I can fix this error? It only seems to flag now and again?

Thanks.
col_num = col_num + 1
col_sum(col_num) = col_sum(col_num) + sign * cdbl(itm.Value)
										if (sign * cdbl(itm.Value)) > 0 then
											fontcolor_st = ""
											fontcolor_et = ""
										else
											fontcolor_st = "<font color=red>"
											fontcolor_et = "</font>"
										end if
										Response.Write "<td class=s1d1_ce_r valign=top >" & fontcolor_st & GetYourFormat(sign * cdbl(itm.Value),number_format) & fontcolor_et & "</td>"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of VBClassicGuy
VBClassicGuy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aspnet-scotland

ASKER

I also get the error on the first line of the attached if you could help...
if (sign * cdbl(itm.Value)) > 0 then
											fontcolor_st = ""
											fontcolor_et = ""
										else
											fontcolor_st = "<font color=red>"
											fontcolor_et = "</font>"
										end if

Open in new window

I tried the attached but I still get the error?
if (sign * cdbl(itm.Value)) > 0 OR isNull(sign * cdbl(itm.Value)) then
											fontcolor_st = ""
											fontcolor_et = ""
										else
											fontcolor_st = "<font color=red>"
											fontcolor_et = "</font>"
										end if

Open in new window

I think you have to do a check for "not null" on itm.Value all bu itself first, before you evaluate or do anything else. Just like my first example, make sure itm.Value is not null, then procede with your code.