hier ein Makro was genau das tut:
Code: Alles auswählen
Sub S_print_multiple_tables
odoc=thiscomponent
osheets=odoc.sheets
ncount=osheets.count
oRanges = odoc.createInstance("com.sun.star.sheet.SheetCellRanges")
'Tabellenblätter finden
for i=0 to nCount-1
if osheets(i).getcellbyposition(0,0).value>0 then 'Wenn A1 größer 0
oRange = osheets(i).getCellRangeByName("A1")
oRanges.addRangeAddress(oRange.RangeAddress, True)
endif
next i
'Tabellenblätter auswählen
oController = odoc.currentcontroller
oController.select(oRanges)
'und drucken
dim printProp() as new com.sun.star.beans.PropertyValue
odoc.print(printProp())
End Sub
Gruß R