Option Strict On disallows implicit conversions from String to Double


#1

Hi,
I’m trying to write a formula in an excel cell by declaring the formula in a variable.

=+IFERROR(X14N14,"-")+(AD14(N141.25))+(AF14(N141.5))+(AB14(N141.1))+IFERROR(Z14O14,"-")+(AD14*(O141.25))+(AF14(O141.5))+(AB14(AB14*1.1))

But I’m getting an error of: Option Strict On disallows implicit conversions from String to Double. Can you please recommend a better way to write that formula in excel cell.


#2

Share your workflow


#3

if you are storing the formula itself in a variable it is a string (text of formula to write).

The result of the formula might be a double.

Maybe you declared your variable as double but are actually trying to save the string in there?


#4


#5

hey, see if this works
“=+IFERROR(X14N14,”"-"")+(AD14(N141.25))+(AF14(N141.5))+(AB14(N141.1))+IFERROR(Z14O14,""-"")+(AD14*(O141.25))+(AF14(O141.5))+(AB14(AB14*1.1))"

“-” was “interrupting” your quotes/sting, I double quoted them and the error disappeared…


#6

Thank you! This works!.