OLEDBConnection.LocaleID Property (Excel)

Returns or sets the locale identifier for the specified connection. Read/write

Version Information

Version Added: Excel 2010

Syntax

expression .LocaleID

expression A variable that represents an OLEDBConnection object.

Return Value

Integer

Remarks

Before you set the LocaleID property to a new locale, you must set the RetrieveInOfficeUILang property of the OLEDBConnection object to False. For more information about valid Locale ID (LCID) values, search the MSDN Web site for "Locale IDs Assigned by Microsoft".

Example

The following code example switches the language of the connection to Spanish.

Dim myConnection As OLEDBConnection 
Set myConnection = ThisWorkbook.Connections(1) 
 
With myConnection 
 .RetrieveInOfficeUILang = False 
 .LocaleID = 3082 
End With

See Also

Concepts

OLEDBConnection Object

OLEDBConnection Object Members