Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I load an excel file in QV.
Then, I create a TableBox object with the main fields from my excel file.
I would like to build a macro calling the fields of my TableBox.
In Visual Basic (in excel), it’s similar to do: worksheets(“Sheet1”).cells(“A1:A1”).value or ThisWorkbook.Worksheets("Sheet1")
I think there is an equivalence in QV.
Please could you help me to call a particular field from my table box in a QV macro.
Thank you in advance for your help.
This is from the API Guide:
set table = ActiveDocument.GetSheetObject( "CH01" )
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = table.GetColumnCount
CellRect.Height = table.GetRowCount
set CellMatrix = table.GetCells( CellRect )
for RowIter = 0 to CellMatrix.Count-1
for ColIter=0 to CellMatrix.Item(RowIter).Count-1
set cell = CellMatrix.Item(RowIter).Item(ColIter)
msgbox(cell.Text)
next
next
The attached qvw contains a macro that recalls the values of each field in the tablebox.
Hello @m_woolf,
Thank you for your help but I can't open the file test1.qvw due to the security of my computer.
Please could you show me the macro of this file in screenshot or message.
Thank you in advance for your consideration.
This is from the API Guide:
set table = ActiveDocument.GetSheetObject( "CH01" )
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = table.GetColumnCount
CellRect.Height = table.GetRowCount
set CellMatrix = table.GetCells( CellRect )
for RowIter = 0 to CellMatrix.Count-1
for ColIter=0 to CellMatrix.Item(RowIter).Count-1
set cell = CellMatrix.Item(RowIter).Item(ColIter)
msgbox(cell.Text)
next
next