Message 1 of 5
Error: Object Variable or With block variable not set

Not applicable
10-29-2019
12:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Please help. With this iLogic rule run as external rule, I am intermittently getting the error: Object Variable or With block variable not set with the codes below:
Sub Main() Dim oDoc As Document oDoc = ThisDoc.Document Dim BORDERNAME as String BORDERNAME=Parameter("KINZEBORDER") Dim cd cd = ThisApplication.CommandManager.ControlDefinitions("DrawingBorderInsertNoDlgCtxCmd") Dim bp bp = ThisApplication.ActiveDocument.BrowserPanes("DlHierarchy") Dim node node = FindBorderNode(BORDERNAME, bp.TopNode.BrowserNodes) If Not ThisDoc.Document.ActiveSheet.Border Is Nothing Then ThisDoc.Document.ActiveSheet.Border.Delete End If node.DoSelect cd.Execute2 (True) End Sub Function FindBorderNode(name, nodes) Dim node For Each node In nodes If name = node.BrowserNodeDefinition.Label Then FindBorderNode = node Exit Function End If FindBorderNode = FindBorderNode(name, node.BrowserNodes) If Not FindBorderNode Is Nothing Then Exit Function End If Next End Function