Tips for intl Excel sheets

mfabianmfabian Member Posts: 187
edited 2000-07-19 in Navision Financials
Hi programmers,

If you create an excel worksheet using Navision Automation, you run into a problem if your application should run in different countries as Excel formulas are language-dependend.

This applies for example to the "SUM()" formula which reads "SUMME()" in German Excel.

My Tip: Use the Application.International property to determine the language installed.

Procedure InitConstants;

CountryCode := xlApplication.International(1); //1=xlCountryCode
CASE CountryCode OF
// English
0, // Default
1, // USA
2, // Canada
44, // United Kingdom
61, // Australia
64, // New Zealand
353 // Ireland
: BEGIN
xlFormulaSUM := '=SUM';
END;
// Deutsch
41, // Schweiz
43, // Österreich
49 // Deutschland
: BEGIN // Deutsch
xlFormulaSUM := '=SUMME';
END;
ELSE
ERROR ('Unknown Excel Country-Code %1 ',xlApplication.International(1));
{
============= NOTE FOR THE PROGRAMMER ==============
Include the language in question according to this list:
CTRY_DEFAULT = 0;
CTRY_AUSTRALIA = 61; // Australia
CTRY_AUSTRIA = 43; // Austria
CTRY_BELGIUM = 32; // Belgium
CTRY_BRAZIL = 55; // Brazil
CTRY_CANADA = 2; // Canada
CTRY_DENMARK = 45; // Denmark
CTRY_FINLAND = 358; // Finland
CTRY_FRANCE = 33; // France
CTRY_GERMANY = 49; // Germany
CTRY_ICELAND = 354; // Iceland
CTRY_IRELAND = 353; // Ireland
CTRY_ITALY = 39; // Italy
CTRY_JAPAN = 81; // Japan
CTRY_MEXICO = 52; // Mexico
CTRY_NETHERLANDS = 31; // Netherlands
CTRY_NEW_ZEALAND = 64; // New Zealand
CTRY_NORWAY = 47; // Norway
CTRY_PORTUGAL = 351; // Portugal
CTRY_PRCHINA = 86; // PR China
CTRY_SOUTH_KOREA = 82; // South Korea
CTRY_SPAIN = 34; // Spain
CTRY_SWEDEN = 46; // Sweden
CTRY_SWITZERLAND = 41; // Switzerland
CTRY_TAIWAN = 886; // Taiwan
CTRY_UNITED_KINGDOM = 44; // United Kingdom
CTRY_UNITED_STATES = 1; // United States
}
END;
End; // Procedure

Hope you find this useful



Marcus Fabian
m.fabian@thenet.ch
+41 79 439 78 72
With best regards from Switzerland

Marcus Fabian
Sign In or Register to comment.