EBDN - Community - Question & Answers

  Monday, 20 May 2019
  2 Replies
  1.5K Visits
0
Votes
Undo
No matter how I put in the data: The SheetOp returns with error 2447.
I got the same error when putting in the symbolGUID-string in a wrong format on Coloring the symbols.

Does anyone know what and how the data should be put in?

The last variation of many tests:
Private Sub SelectSymbols(oCurSheet As Sheet, sSymbolIDs() As String)

Dim i As Integer
Dim atParamData() As Aucotec.AucExecuteSheetRecord
Dim atSymData() As Aucotec.AucExecuteSheetRecord
Dim sGUID As String
Dim iIDlength As Integer

ReDim atParamData(1 To 2)
'If Not oCurSheet.IsOpened Then Call oCurSheet.Open(aucSheetOpenAutosave)

On Error Resume Next
For i = LBound(sSymbolIDs) To UBound(sSymbolIDs)
ReDim atSymData(1 To 2)
atSymData(1).qual = aucArgExecSheetRef2Symbol
atSymData(1).Val = "00000000-0000-0000-0000-000001168AE4"
'atSymData(2).Val = 134
'atSymData(2).Val = 0
atSymData(2).qual = aucArgExecSheetOperationMode
atSymData(2).Val = aucModExecSheetSelectSymbolsSave

atParamData(1).qual = aucOpExecSheetSelectSymbol
atParamData(1).Val = atSymData()
'atParamData(2).qual = aucArgExecSheetRef2Symbol 'symbol reference
'Reference comes in format like 0x01168AE4, convert to GUID format like 00000000-0000-0000-0000-000001168AE4
'sGUID = Mid$(sSymbolIDs(i), 3)
'iIDlength = Len(sGUID)
'sGUID = Left("000000000000", 12 - iIDlength) & sGUID
'atParamData(3).qual = aucArgExecSheetOperationMode
'atParamData(3).Val = aucModExecSheetSelectSymbolsSave
'atParamData(3).Val = 0

atParamData(2).qual = aucArgExecSheetFctSel
atParamData(2).Val = 0 'Select Symbol only, no connections

Call Utils.ExecuteSheetOperation(oCurSheet, atParamData)
If Err.Number <> 0 Then
MsgBox (Err.Description)
End If
MsgBox ("Selection : " & oCurSheet.Selection.Count & " Symbols";)

Next i

End Sub