复制后的Excel图像未导出到PDF



在此处将一系列单元格复制为单独的工作表。单元格的范围会根据另一个工作表上的自我选择自动填充 - 因此,这有效地构建了一系列旨在BE和指示包的图像。

现在已经写了一些以导出到PDF的东西 - 打印区域使用偏移函数,具体取决于所选的指标数量。

,但出口到PDF运行但不拿起图片 - 您可以帮忙吗?

Sub printPDFSave()
Dim rng As Range
Dim fPathFile As Variant
Set rng = [Destination]
fPathFile = Application.GetSaveAsFilename(filefilter:="PDF Files (*.pdf), *.pdf")
If fPathFile <> False Then
    rng.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fPathFile,  Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False,  OpenAfterPublish:=False
End If
End Sub

请尝试以下..我们假设图像在Sheep2

Option Explicit
Sub printPDFSave()
Dim rng As Range
Dim fPathFile As Variant
Dim sh As Shape
Dim ShRow As Long
For Each sh In Sheet2.Shapes
    ShRow = sh.BottomRightCell.Row
Nex
Set rng = Sheet2.Range("A1:K" & ShRow)
fPathFile = Application.GetSaveAsFilename(filefilter:="PDF Files (*.pdf), *.pdf")
If fPathFile <> False Then
    rng.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fPathFile, Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End If
End Sub

最新更新