Forum Discussion

tarana08's avatar
tarana08
Frequent Visitor
6 years ago

Project.Variables.TblColumnID.Item(0, Count) failed

 

 

Script is failing becuase it trying to call the "name" method or property of an object that does not exist.

 

 

This is what stored into ColumnID script 

Sub StoreColumnIDs(GridObject)
'Store all ColumnIDs to TblColumnID
Log.AppendFolder("StoreColumnIDs: " & GridObject.name)
Call Log.Picture(sys.Desktop,"Screenshot")
For Count = 0 To (GridObject.Cols.Count - 1 )Step 1
GridObject.Row = 0
GridObject.Col = Count
Project.Variables.TblColumnID.Item(0, Count) = Count

Set Project.Variables.TblColumnID.Item(1, Count)= GridObject.Clip
Log.Message(Project.Variables.TblColumnID.Item(0, Count) & " - '" & Project.Variables.TblColumnID.Item(1, Count)) & "'"

Next
log.PopLogFolder
End Sub

Sub GetColumnID(ColumnName)
'Find ColumnID from TblColumnID
'Set Project.Variables.TempInt2 = ColumnID
' Set regEx = New RegExp
' regEx.Pattern = ColumnName
' regEx.Global = True
' If regEx.test(Project.Variables.TblColumnID.Item(1, Count)) = True Then
For Count = 0 to 299 Step 1

If Project.Variables.TblColumnID.Item(1, Count) = ColumnName Then

Project.Variables.TempInt2 = Project.Variables.TblColumnID.Item(0,Count)
Exit For
End If
Next
Log.Message("'" & ColumnName & "' - " & Project.Variables.TempInt2)

End Sub

Sub StoreColumnIDs_AEInbox(ParentObject) 'sub routine works for AEInbox Tables and Eleven Tables (e.g. Eleven Edit Station Change)
Log.AppendFolder("StoreColumnIDs: " & ParentObject.name)
Call Log.Picture(sys.Desktop,"Screenshot")
For Count = 0 to ParentObject.ColumnCount(0)-1 Step 1
Project.Variables.TblColumnID.Item(0, Count) = Count
Project.Variables.TblColumnID.Item(1, Count) = ParentObject.Cell(0,Count).ContentText
Log.Message(Project.Variables.TblColumnID.Item(0, Count) & " - '" & Project.Variables.TblColumnID.Item(1, Count)) & "'"
Next
log.PopLogFolder
End Sub

Sub StoreColumnIDs_Eleven(ColumnHeaderObject) 'Sub routine works with slickgrids - AEinbox Enter Station Change and Eleven slick grid
'USE THIS ColumnHeaderObject Aliases.browser.pageEleven2.panelOrderbar.panelOrderGridSlickgridUiWidgetS.panelSlickPaneSlickPaneHeaderSli.panelUiStateDefaultSlickHeaderSl.Panel(0)

'Use this columnheader object for AEinbox enter station change Aliases.Browser.Find("Name", "*Panel*slickGrid*", 10).Panel(1).panel(0).panel(0)
Call Log.Picture(sys.Desktop,"Screenshot")
Log.AppendFolder("StoreColumnIDs: " & ColumnHeaderObject.name)
For Count = 0 to ColumnHeaderObject.childNodes.length - 1
Project.Variables.TblColumnID.Item(0, Count) = Count
Project.Variables.TblColumnID.Item(1, Count) = ColumnHeaderObject.childNodes.item(Count).textContent
Log.Message(Project.Variables.TblColumnID.Item(0, Count) & " - '" & Project.Variables.TblColumnID.Item(1, Count)) & "'"
Next
log.PopLogFolder
End Sub

Sub ClickCell(GridObject, rowIndex, colIndex, clickType)

x = GridObject.Getcellrectdisplay(rowIndex, colIndex).X+5
y = GridObject.Getcellrectdisplay(rowIndex, colIndex).Y+(GridObject.Getcellrectdisplay(rowIndex, colIndex).height)/2

If clickType = "Click" then
GridObject.Click x,y
elseif clickType = "ClickR" then
GridObject.ClickR x,y
elseif clickType = "ClickM" then
GridObject.ClickM x,y
elseif clickType = "DblClick" then
GridObject.DblClick x,y
elseif clickType = "DblClickR" then
GridObject.DblClickR x,y
elseif clickType = "DblClickM" then
GridObject.DblClickM x,y
Else log.Warning ("No clickType selected. Use Click, ClickR, ClickM, DblClick, DblClickR, DblClickM")
End If

End Sub

 

 

 

 

 

Script is failing becuase it is not able to find prant object name 

Project.Variables.TblColumnID.Item(0, Count) = Count

 

Can someone please help me.

Thanks!

 

2 Replies