SAP Knowledge Base Article - Public

3630688 - In AO workbook the column widths may reached the Excel maximum limit of 255

Symptom

  • Upon opening a workbook from AO, the column widths are displayed as 255. 
  • The column widths may suddenly changed to 255 after adding a characteristic to column for a workbook in Design Panel of AO.
  • The setting "Optimum Cell Width/Height" has already checked.

Environment

SAP Analysis for Microsoft Office

Reproducing the Issue

  1. Open AO workbook and refresh it, the column widths are displayed as 255.
  2. Or adding a characteristic to column in Design Panel, the column widths are changed to 255.

Cause

The font used in the workbook is Verdana and language is Japanese. For Japanese, if fonts is Verdana may render slightly larger widths under certain conditions. As a result, this can cause column widths to reach the Excel maximum limit of 255. 

Resolution

There are two workarounds to resolve it:

  1. Switching the font to Meiryo as per the following steps:
    1.   Open the workbook.
    2.   Go to the Home tab.
    3.   In the Ribbon bar, locate the Styles section and click on Cell Styles.
    4.   Styles to Update:  

      SAPMemberCell

      SAPDataCell

      SAPDimensionCell

      SAPMemberTotalCell

      SAPDataTotalCell

    5. Right-click the style you want to change and select Modify.

       

    6. Click Format button, in the Font tab, choose another font Meiryo, a monospaced font optimized for East Asian languages, generally handles spacing and width differently, potentially preventing the cell width from hitting the maximum limit of 255.



    7. Click OK to apply the changes.
    8. After completing all font updates, save the workbook to retain the changes.
  2. Use the following VBA script to automatically update the font for the AO custom styles to Meiryo, and then save the workbook. 

    Sub UpdateMultipleMemberCellStyles()

        Dim styleNames As Variant

        Dim styleName As String

        Dim memberStyle As Style

        Dim fontName As String

        Dim fontSize As Single

        Dim i As Integer

     'Customize your desired font settings here

        fontName = "Meiryo"

     'List of custom style names to update

       styleNames = Array("SAPMemberCell", "SAPDataCell", "SAPDimensionCell", "SAPMemberTotalCell", "SAPDataTotalCel")

     For i = LBound(styleNames) To UBound(styleNames)

            styleName = styleNames(i)

            On Error Resume Next

            Set memberStyle = ThisWorkbook.Styles(styleName)

            If Err.Number = 0 And Not memberStyle Is Nothing Then

                With memberStyle.Font

                .Name = fontName               

                End With

                Debug.Print "Updated style: " & styleName

            Else

                Debug.Print "Style not found: " & styleName

            End If

            On Error GoTo 0

            Set memberStyle = Nothing

        Next i

        MsgBox "Font update completed for selected styles ", vbInformation

    End Sub



Keywords

Analysis, Office, AO, format, column widths,  changed, Verdana, Cell Styles, Styles section, widen , KBA , BI-RA-AO-XLA , Excel Addin , Problem

Product

SAP Analysis for Microsoft Office 2.8