Skip to Content
0
Former Member
Sep 02, 2011 at 03:21 AM

error occur when retrieve oGrid value from the existing FormUsingOveridable

49 Views

hi, i was trying to get oGrid value from the existing screen, Batch Number Selection. So, i was using the Overidable based on form id.

i put the below code in the initialize method , but got this error .Any idea or solution ?

Thanks.

Code

====================================

Dim oRefItem As SAPbouiCOM.Item

oRefItem = Form.Items.Item("4")

oGrid = oRefItem.Specific

For i As Integer = 0 To oGrid.Rows.Count - 1

BaseAddOn.Application.MessageBox(oGrid.DataTable.GetValue(0, i))

Next

==========================================

Error

=========================================

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject'

to interface type 'SAPbouiCOM.Grid'. This operation failed because the QueryInterface

call on the COM component for the interface with IID '{856B9291-F296-4A2E-8EB8-FF9189E23425}' failed due to the following error: No such

interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

==================================================