Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jmR jmR is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
jmR jmR is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel smart tags programming with .NET - recognizing formulas? ilvyanyatka Excel Programming 0 May 12th 08 02:39 PM
Excel 2000 vs 2003 programming problem? Andre Croteau Excel Programming 1 November 28th 06 02:11 PM
ADO recordset XML format for globalization Gail Hurn Excel Programming 0 August 29th 06 05:40 PM
Solver and Excel programming problem AAB Excel Programming 0 February 3rd 04 12:57 AM
Excel programming problem Peter Hansson Excel Programming 2 November 9th 03 03:19 PM


All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"