Tips for intl Excel sheets

mfabian
Member Posts: 187
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
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
Marcus Fabian
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions