Excel problem

Hi! I hope that someone can help me! I must send some data to excel, and i had writen some code, but I have a mistake. I need: 1. Define a variable as Option (i did that in c/al Globals) with the values Sales (LCY),Balance (LCY). Call it ShowType. But I dont know how can I assign values Sales (LCY),Balance (LCY) to Options. 2. then i inserted IF ShowType = ShowType::“Sales (LCY)” THEN BEGIN CustAmount.“Amount (LCY)” := -“Sales (LCY)”; CustAmount.“Amount 2 (LCY)” := -“Balance (LCY)”; But here i got an error message (You cannot enter ‘Sales (LCY)’ in Option. The cursor is in front of the invalid character.) How can i solve this problem?

  1. To set values on an option variable you’ve two different ways: a) Set the value as an integer, where the first option is 0,the second is 1 and option n is n-1. b) Set the value as a reference from the variable variablename::“variable value” like you seem to have done on your example… example: if the variable is called myoption and the option string is Option1,Option2 to set the value on the variable to be Option2 you can do in these two ways: // version a) myoption := 1; // version b) myoption := myoption::"Option2"; Your error looks like if you’re having something like: Showtype := ‘Sales (LCY)’; Check your code and change it to be like: Showtype := Showtype::“Sales (LCY)” Regards,

Hi Igor, I Think your problem is that you have a variable named “Sales (LCY)” AND an option value with the same name.