Can't sum items in double variable(excel)

variable(double)=CDbl(Recon_Sched_DT.Rows(0).Item(4).ToString)+CDbl(Recon_Sched_DT.Rows(0).Item(7).ToString)+CDbl(Recon_Sched_DT.Rows(0).Item(12).ToString)+CDbl(Recon_Sched_DT.Rows(0).Item(16).ToString)+CDbl(Recon_Sched_DT.Rows(0).Item(20).ToString)+CDbl(Recon_Sched_DT.Rows(0).Item(25).ToString)+CDbl(Recon_Sched_DT.Rows(0).Item(29).ToString)

@ldiaz

Please run in debug and check the error details from locals panel …

And also are all the columns you specified are having valid double values? Or are there any blanks and special characters or spaces

Cheers

check for any empty values in the string and also change the code and assign some default decimal value if the string is empty
note: using try catch block will identify the issue easily.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.