Hi I’m moving from Excel macro
firstly Excel is also not having a direct option to export cell range into image file.
so I’m using work-around method by create empty chart object and then paste cell range image into the chart.
and then now I can export chart as image file.
now I can’t run the same code with LibreOffice Calc
any expert here can help me out please…
this code works Thank you JohnSUN
but still problem with pop-up window asking for jpg option.
how to disable it ?
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$B$2:$F$40"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(3) as new com.sun.star.beans.PropertyValue
args2(0).Name = "URL"
args2(0).Value = "file:///C:/Users/Desktop/Doc/picture/image.jpg"
args2(1).Name = "FilterName"
args2(1).Value = "calc_jpg_Export"
args2(2).Name = "FilterData"
args2(2).Value = Array(Array("ColorMode",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Quality",0,100,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("PixelWidth",0,794,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("PixelHeight",0,1123,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("LogicalWidth",0,21005,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("LogicalHeight",0,29708,com.sun.star.beans.PropertyState.DIRECT_VALUE))
args2(3).Name = "SelectionOnly"
args2(3).Value = true
dispatcher.executeDispatch(document, ".uno:ExportTo", "", 0, args2())