Hi All
I have a macro in calc to print the current sheet. It was working in Windows system. But the same macro is not working in elementary OS. Its not throwing any error also. Please help me in this
Thanks
Originally added as answer - 2020-11-29
Sorry guys
Here is the macro I am using
Sub printreport(sSheetName1 as String)
Dim args2(2) as New com.sun.star.beans.PropertyValue
Dim dispatcher as Object
reportSheet = oDoc.Sheets.getByName(sSheetName1)
reportSheet.IsVisible = TRUE
ThisComponent.CurrentController.ActiveSheet = reportSheet
oReport = ThisComponent.CurrentController.Frame
args2(0).Name = "Copies"
args2(0).Value = 1
args2(1).Name = "Selection"
args2(1).Value = true
args2(2).Name = "Collate"
args2(2).Value = false
Msgbox("Printing")
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(oReport, ".uno:Print", "", 0, args2())
Msgbox("Please click Ok only after Page Printed")
reportSheet.IsVisible = False
End Sub
I haven’t yet connected to any printer yet, but in Windows when this macro is called it is opening the Print dialog, and in elementary OS Print dialog is not opening and not throwing any error message.
Thanks all
[Edit - Opaque] Moved from an answer to details of question - Deleted answer, which did not answer this question.