Type conversion exception problem

Phase1 Industry Project Weekly Stock Price.zip (111.3 KB)
Hi, When I first run this project it worked perfectly fine. But now it is giving me type conversion problem for average close price and volume. Please help me with this asap.

Hello @Priyanka_Jharia

Could you please share the full error which you are getting and in which activity you are facing this issue.

image
In this following activity I think because of the expression.



and I use this expression
ReadTstWkb3.AsEnumerable().Average(Function(row) cDbl(row(“Close”).ToString.Trim))

@Priyanka_Jharia ,

Try changing the Expression to the Below and Check :

ReadTstWkb3.AsEnumerable().Average(Function(row) if(String.IsNullOrWhiteSpace(row("Close").ToString.Trim),0,cDbl(row("Close").ToString.Trim)))

Didn’t Work. Giving the same exception.

@Priyanka_Jharia ,

Are you using the above Expression directly in the Write Cell Activity and Checking it ?

If so, Could you just use the Expression in a Message Box before using in the Write Cell Activity to Check if it gives out an Error in it as well ?

Also Share the Screenshot of the Expression used in the Message Box.

image
Hey, It didn’t gave error in Message Box as you can see and I used the same expression that you gave me in the message box but I have to write it in excel sheet in which it is creating error still. Please let me know how can I do this.

@Priyanka_Jharia ,

Does it give out the Same Error or a Different Error ?

same error

@Priyanka_Jharia ,

In that case, Could you try Assigning that Expression to a Double Type variable and then use that variable in the Write Cell Activity ?

same error I faced…

Hey I resolved it by myself thankyou for your input.

Did you have the same problem like me that it first worked great then it created error?

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