Hi all, I am new to programming and vbscript as a whole so I apologize if my question comes across as fairly obvious, or if I have posted incorrectly. I have scraped google but no answer really made sense to me. Basically I am getting a "type mismatch error" when I try and run the following code (which I have condensed for simplicity.)
Dim sNum1, sNum2, sTotal, sNum3 sOthertotal
After I declare those variables I grab the values of sNum1 and sNum2 with the gettext method. Then I say
sTotal = sNum1, sNum2
After this I want it to write this sOthertotal in another field so I do something like this
sOthertotal = sTotal - sNum3
.Sendkeys sOthertotal
So the error occurs with the sTotal - sNum3 line. I realize it has something to do with not being able to subtract a the total that was determined earlier in the script but I'm not sure how to fix it... I saw in some places that it's because strings are involved but being fairly new I'm not too familiar with a lot of that.
Any simplistic help offered would be greatly appreciated, thanks everyone!
Dim sNum1, sNum2, sTotal, sNum3 sOthertotal
After I declare those variables I grab the values of sNum1 and sNum2 with the gettext method. Then I say
sTotal = sNum1, sNum2
After this I want it to write this sOthertotal in another field so I do something like this
sOthertotal = sTotal - sNum3
.Sendkeys sOthertotal
So the error occurs with the sTotal - sNum3 line. I realize it has something to do with not being able to subtract a the total that was determined earlier in the script but I'm not sure how to fix it... I saw in some places that it's because strings are involved but being fairly new I'm not too familiar with a lot of that.
Any simplistic help offered would be greatly appreciated, thanks everyone!