Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel programming of formulas and globalization problem
I've created an .Net application that fill a excel sheet. For some of the
cells, my application write a formula instead of a direct value. I'm writing somthing like : oSheet2.Cells(x, y).formula = "=SOMME(CALC!A" & a & ":CALC!A" & b & ")/AY" & c All this works fine on a FRENCH environment. It doesn't work on an ENGLISH Excel environment. My question is : How to do something that works with both French and English ? Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel programming of formulas and globalization problem
You app can only do what a human would do when entering a formula. The human
would have to know to use =SUM() in English and to use =SOMME() in French. You app needs some kind of global flag to indate the language setting for Office and pick the functions accordingly. -- Gary''s Student - gsnu200812 "jmR" wrote: I've created an .Net application that fill a excel sheet. For some of the cells, my application write a formula instead of a direct value. I'm writing somthing like : oSheet2.Cells(x, y).formula = "=SOMME(CALC!A" & a & ":CALC!A" & b & ")/AY" & c All this works fine on a FRENCH environment. It doesn't work on an ENGLISH Excel environment. My question is : How to do something that works with both French and English ? Thanks in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel programming of formulas and globalization problem
Thanks for your prompt reply. Then, do you known if there is a property in
excel application or worksheet object that could help me to detect the excel language ? Thanks in advance "Gary''s Student" wrote: You app can only do what a human would do when entering a formula. The human would have to know to use =SUM() in English and to use =SOMME() in French. You app needs some kind of global flag to indate the language setting for Office and pick the functions accordingly. -- Gary''s Student - gsnu200812 "jmR" wrote: I've created an .Net application that fill a excel sheet. For some of the cells, my application write a formula instead of a direct value. I'm writing somthing like : oSheet2.Cells(x, y).formula = "=SOMME(CALC!A" & a & ":CALC!A" & b & ")/AY" & c All this works fine on a FRENCH environment. It doesn't work on an ENGLISH Excel environment. My question is : How to do something that works with both French and English ? Thanks in advance. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel programming of formulas and globalization problem
I don't know.
However, within VBA, it is easy to test: Sub languagetest() Dim strg As String Range("A1").Formula = "=SOMME(B1:B2)" strg = Range("A1").Text If strg = "#NAME?" Then MsgBox ("Clearly not French") End If End Sub -- Gary''s Student - gsnu200812 "jmR" wrote: Thanks for your prompt reply. Then, do you known if there is a property in excel application or worksheet object that could help me to detect the excel language ? Thanks in advance "Gary''s Student" wrote: You app can only do what a human would do when entering a formula. The human would have to know to use =SUM() in English and to use =SOMME() in French. You app needs some kind of global flag to indate the language setting for Office and pick the functions accordingly. -- Gary''s Student - gsnu200812 "jmR" wrote: I've created an .Net application that fill a excel sheet. For some of the cells, my application write a formula instead of a direct value. I'm writing somthing like : oSheet2.Cells(x, y).formula = "=SOMME(CALC!A" & a & ":CALC!A" & b & ")/AY" & c All this works fine on a FRENCH environment. It doesn't work on an ENGLISH Excel environment. My question is : How to do something that works with both French and English ? Thanks in advance. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel programming of formulas and globalization problem
I don't know about .net, but in VBA you can use the .Formula property with
the English formula and it will be translated automatically. Or you can use the .FormulaLocal property and use the language of the application for the formula. -- Kind regards, Niek Otten Microsoft MVP - Excel "jmR" wrote in message ... I've created an .Net application that fill a excel sheet. For some of the cells, my application write a formula instead of a direct value. I'm writing somthing like : oSheet2.Cells(x, y).formula = "=SOMME(CALC!A" & a & ":CALC!A" & b & ")/AY" & c All this works fine on a FRENCH environment. It doesn't work on an ENGLISH Excel environment. My question is : How to do something that works with both French and English ? Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel smart tags programming with .NET - recognizing formulas? | Excel Programming | |||
Excel 2000 vs 2003 programming problem? | Excel Programming | |||
ADO recordset XML format for globalization | Excel Programming | |||
Solver and Excel programming problem | Excel Programming | |||
Excel programming problem | Excel Programming |