Chapter 7. Column Name Translation

Chapter 7. Column Name Translation

The Payments table shows fields in the table and at the ribbon like AccountID, CompanyID, and ItemID.

Let's change these database field names to business names.

Switch to the payments-configuration workbook, select the ColumnTranslation worksheet and add the data:

ColumnTranslation configuration table

 

Then switch to the payments workbook and click Options:

Choose a language in the SaveToDB Options

Choose the Default data language as English and click OK.

Of course, in your applications, you may use any language or even multiple languages.

 

Click Reload, Reload Data and Configuration.

Sample of translated columns in Microsoft Excel

The add-in shows Account, Company, and Item instead of AccountID, CompanyID, and ItemID.

You may turn off this feature in the Options dialog box as described above.

Setting data languages using VBA

The following code is used to change the data language and reload configurations on all worksheets:

' Sets a new language and reloads data and configurations, Chapter 7

Sub Chapter07_1_SetLanguage()

    Dim addIn As Object
    Set addIn = GetAddInAndCheck()

    If addIn Is Nothing Then Exit Sub

    addIn.Options.DefaultDataLanguage = "en-US"

    Dim ws As Worksheet

    For Each ws In ActiveWorkbook.Worksheets
        Call addIn.LoadAllSheetTables(ws, True)
    Next

End Sub

You may use the addIn.Options property to change other SaveToDB add-in options too.