Skip to Main Content
Need Support? Let’s guide you to the right answer or agent.
Status Needs review
Categories General
Created by Guest
Created on Oct 28, 2026

Standards checker bylevel checker

Standards checker delivered example (SCByLevel.mvba) is not working as expected. Even if Cell header is set to false in settings it still checks cell components for level/style/weight
The CheckComponents function is flawed as it doesn't pass down the stream that component is part of cell so the cell header standard settings are ignored.
Why even provide CellHeader as standard when cell headers don't have attributes to check?


  • Guest
    Oct 28, 2026

    Pass the containing cell's ele.Type to CheckElement, and let CheckElement decide which standard to use. If no override is supplied, it uses the element's own type as before.

    1. Update CheckElement

    Change the function signature and standard lookup to:

    Private Sub CheckElement(ByVal ele As Element, _
    Optional ByVal standardType As Variant)

    Dim oStandard As clsByLevelStandardData
    Dim colorError As Boolean, styleError As Boolean, weightError As Boolean
    Dim nErrors As Integer

    On Error GoTo ReportError

    ' Use the supplied standard type when present.
    ' Otherwise, use the element's own type.
    If IsMissing(standardType) Then
    Set oStandard = byLevelStandards(ele.Type)
    Else
    Set oStandard = byLevelStandards(CLng(standardType))
    End If

    ' Keep the rest of your existing CheckElement code here.

    Keep the remainder of existing function.

    2. Update CheckComponents

    Only one change the call to CheckElement:

    Private Sub CheckComponents(ele As ComplexElement)
    Dim ee As ElementEnumerator

    Set ee = ele.GetSubElements

    Do While ee.MoveNext
    If m_aborted Then Exit Sub

    If ee.Current.IsCellElement Then
    CheckComponents ee.Current
    Else
    ' Pass the containing cell's type as the standard override.
    CheckElement ee.Current, ele.Type
    End If
    Loop
    End Sub