OLEDBConnection.LocaleID property (Excel)

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

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 to False. For more information about valid Locale ID (LCID) values, see the LCID-Locale Mapping Table.

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.