OLEDBConnection.LocaleID Property (Excel)

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

Version Added: Excel 2010

expression .LocaleID

expression A variable that represents an OLEDBConnection object.

Return Value


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".

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