Megosztás a következőn keresztül:


Globalization Considerations for Excel Controls

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Document-level projects

  • Application-level projects

Microsoft Office version

  • Excel 2003

  • Excel 2007

For more information, see Features Available by Application and Project Type.

By default, host controls in Microsoft Office Excel work correctly in any Windows regional setting, as long as all data that is passed or manipulated using managed code is formatted using English (United States) formatting. This behavior is in effect as long as the ExcelLocale1033Attribute is set to true. For more information, see Formatting Data in Excel with Various Regional Settings.

However, if you set the ExcelLocale1033Attribute to false, host controls do not work correctly if the end user has an English language version of Excel, but has Windows regional settings for a region other than English (United States). You can resolve the issues by installing the Multilingual User Interface (MUI) pack.

When the ExcelLocale1033Attribute Is False

The functionality of host controls in Excel, such as data binding and events, relies on calls to the Microsoft Office Excel object model through the primary interop assemblies (PIAs). If a solution is run on an English version of Excel in a non-"en-US" environment, user interaction with a host control can cause the same errors that can be caused by an explicit programmatic call into the COM object model.

For example, the BeforeDoubleClick event of a NamedRange control might not be raised when the control is double-clicked because a call is made to a method in the Excel object model to determine whether the event occurred within the named range. When the locale passed to this method call is not English (United States), the method fails and the event is not raised. If a localized version of Excel is used, or if the English version of Excel is used along with the MUI pack, these errors will not occur.

See Also

Tasks

How to: Make String Literals Region-safe in Excel Using Reflection

Concepts

Formatting Data in Excel with Various Regional Settings

Globalization and Localization of Office Solutions

Host Items and Host Controls Overview