M
Ming Zhao
I am working on a Visual Studio application that writes a formula to the
..Formula property of an Excel cell. The formula is something that looks like
=IF(AND($A40<>"",$B40<>""),$A40-$B40,"")
It works correctly in English version of Windows XP /Office 2003 but when I
choose Swedish from Regional Options, the Excel cell shows #NAME? error. I
know I need to change . to , (decimal point) and , to ; (separator) for
Swedish. But after the changes it still does not work.
When I click in the cell that shows the error, put the mouse cursor in the
formula box (Fx textbox), and then click the Tab key, the #NAME? error
disappears and the cell shows the result correctly. Alternatively if I type
the formula directly in a cell, it can be shown correctly.
I have tried to write the formula to the .FormulaR1C1 property instead
(having converted the formula to the R1C1 format first) but get the same
result.
Is there anything particular to Excel versions other than English? How to
fix this problem?
Another difference I have noticed is that in English setting, I can compare
a cell against a text string in the condition part of a formula even the cell
is empty, but it will trigger an exception in Swedish setting. I don’t
understand why it is different as this must require different implementation
in Excel itself.
Thanks in advance for any suggestions.
Ming
..Formula property of an Excel cell. The formula is something that looks like
=IF(AND($A40<>"",$B40<>""),$A40-$B40,"")
It works correctly in English version of Windows XP /Office 2003 but when I
choose Swedish from Regional Options, the Excel cell shows #NAME? error. I
know I need to change . to , (decimal point) and , to ; (separator) for
Swedish. But after the changes it still does not work.
When I click in the cell that shows the error, put the mouse cursor in the
formula box (Fx textbox), and then click the Tab key, the #NAME? error
disappears and the cell shows the result correctly. Alternatively if I type
the formula directly in a cell, it can be shown correctly.
I have tried to write the formula to the .FormulaR1C1 property instead
(having converted the formula to the R1C1 format first) but get the same
result.
Is there anything particular to Excel versions other than English? How to
fix this problem?
Another difference I have noticed is that in English setting, I can compare
a cell against a text string in the condition part of a formula even the cell
is empty, but it will trigger an exception in Swedish setting. I don’t
understand why it is different as this must require different implementation
in Excel itself.
Thanks in advance for any suggestions.
Ming