Export range as image

后端 未结 2 450
执笔经年
执笔经年 2021-01-21 01:30

For a while now, my colleagues and me have been using all kinds of methods to create a template to easily make volunteer vacancy forms.

Ideally, the person in charge of

2条回答
  •  死守一世寂寞
    2021-01-21 02:17

    I have been using this a few months, but after upgrading to windows 10 / excel 2016, the export is a blank image. And found that Excel 2016 is a bit slowminded and need everything bit by bit... the with... section should not contain the delete method and the chart need to be activated before paste...

    like this:

    mychart.Activate
     With mychart
        .Height = rng.Height
            .Width = rng.Width
            .Chart.Paste
            .Chart.Export Filename:=strTempfile, Filtername:="PNG"      
        End With
    mychart.Delete
    

提交回复
热议问题