For example:
Sub RefreshDataPilot() Dim oSheet As Object, oTables As Object, oTable As Object oSheet = ThisComponent.CurrentController.ActiveSheet oTables = oSheet.DataPilotTables 'Dim sTableName$ 'sTableName = oTables.ElementNames(0) 'DataPilot1 'oTable = oTables.getByName(sTableName) 'oTable = oTables.getByIndex(0) 'only one table on this sheet oTable = oTables(0) 'oTables("DataPilot1") oTable.refresh End Sub
See:
oTables.getByIndex(0) is oTables(0)
oTables.getByName(“DataPilot1”) is oTables(“DataPilot1”)