用于特定范围导出到高分辨率 jpg 文件的 VBA 屏幕截图

问题描述

我想为特定范围设置屏幕上限并导出为高分辨率的 jpg 文件,有人可以帮忙吗?

Sub cap_A_chi()

    Dim aChart As Chart,Rng As Range,Path As String
    Path = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & "PSSL" & "\" & "A chi.png"
    Set Rng = Sheets("list").Range("B3:J18")

    Call Rng.copyPicture(xlScreen,xlPicture)
    With Sheets.Add
        .Shapes.AddChart
        .Activate
        .Shapes.Item(1).Select
        Set aChart = ActiveChart
        .Shapes.Item(1).Line.Visible = msoFalse
        .Shapes.Item(1).Width = Rng.Width
        .Shapes.Item(1).Height = Rng.Height
        aChart.Paste
        aChart.Export (Path)
        Application.displayAlerts = False
        .Delete
        Application.displayAlerts = True
    End With


End Sub

我正在用这个,但是分辨率低,能不能做成宽1680 x高1280,非常感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)