Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel Range2Image
#6
Member function ExcelSheet.Range2Image
Code:
Copy      Help
function $range $pngFile [double'scale]

Excel.Range r=_Range(range)

r.CopyPicture(Excel.xlScreen Excel.xlPicture)
Excel.Chart im = ws.ChartObjects.Add(33, 39, r.Width, r.Height).Chart

im.Paste
im.ChartArea.Border.LineStyle = 0
if scale>0 and scale!=1.0
,im.ChartArea.Width = im.ChartArea.Width * scale
,im.ChartArea.Height = im.ChartArea.Height * scale
,
,;Scaling fails. DOn't know how to make it work.
,;Error (RT) in <open ":14130: /397">ExcelSheet.Range2Image:  0x80020009, Exception occurred.
,;0x3EC, Unable to set the Width property of the ChartArea class.    <help #IDP_ERR>?

im.export(_s.expandpath(pngFile) "PNG")
im.Parent.Delete

Macro Macro2865
Code:
Copy      Help
str pngFile="$temp$\excel.png"
ExcelSheet es.Init("Sheet1" 1)
es.Range2Image("A1:B2" pngFile)
run pngFile


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)