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
- Open AO workbook and refresh it, the column widths are displayed as 255.
- 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:
- Switching the font to Meiryo as per the following steps:
- Open the workbook.
- Go to the Home tab.
- In the Ribbon bar, locate the Styles section and click on Cell Styles.
- Styles to Update:
SAPMemberCell
SAPDataCell
SAPDimensionCell
SAPMemberTotalCell
SAPDataTotalCell
- Right-click the style you want to change and select Modify.
- 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.
- Click OK to apply the changes.
- After completing all font updates, save the workbook to retain the changes.
- 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
SAP Knowledge Base Article - Public