The information in this article applies to:
SUMMARYIn Microsoft Excel, you can determine the country code that corresponds to the version of Microsoft Excel you are running. These country codes can be helpful in creating custom applications. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspDifferent versions of Microsoft Excel are currently available in over thirty international languages. These languages and their corresponding country codes are listed below:
The codes shown above are derived from the Country Codes used by the
telephone system in the United States of America.
In a custom application, it may be necessary to determine which language version of Microsoft Excel is running. For example, if you are writing a custom application for your company, which has offices in two different countries, the country code would make it possible to write a single macro for both offices. You could display different dialog boxes based on which language version of Microsoft Excel is being used. Below are examples of returning and using the country code in a Microsoft Visual Basic for Applications macro and an XLM macro. Sample Visual Basic ProcedureIn Microsoft Excel versions 5.0 and later you can use the Application.International function to return information about the current country and international settings of Microsoft Excel. The built- in constant "xlCountryCode" will return the country code of the version of Microsoft Excel you are running.Below is a macro example that will return the country code and will then, based on that code, display "Hello" in the appropriate language:
XLM Macro Code ExampleIn Microsoft Excel version 4.0, the GET.WORKSPACE function can be used to return information about the workspace. GET.WORKSPACE has one argument, type_num. Type_Num is a number specifying the type of workspace information you want.To return the country code of the version of Microsoft Excel you are running, use the type number of 37. Type 37 returns a 45-item horizontal array of the items related to country versions and settings. You must index this array to return a specific item. The country code is the first item in this array. Below is a macro example that will index the array of items returned by GET.WORKSPACE(37) to get the country code and then, based on that code, display "Hello" in the appropriate language: A1: Code_Macro REFERENCES"Function Reference," version 4.0, pages 209-212 Additional query words: 4.00a foreign XL7 XL5 XL97
Keywords : kbprg kbdta kbdtacode PgmOthr PgmHowto KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |