VBA将当前打开的表格生成PDF图片

前言

VBA将当前的表格存储成PDF文件进行存储

代码

vbscript 复制代码
Sub ExportToPDF()
    Dim FilePath As String
    Dim FileName As String
    Dim ExportRange As Range
    
    ' 设置导出文件路径及名称
    FilePath = "D:\Users\"
    FileName = "ExportedPDF"
    
    ' 设置导出区域范围
    Set ExportRange = Range("B1:BE38")
    
    ' 导出区域到 PDF 文件
    ExportRange.ExportAsFixedFormat Type:=xlTypePDF, _
        Filename:=FilePath & FileName & ".pdf", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
相关推荐
癫狂的兔子25 分钟前
【Office】【Excel】常用函数公式总结
excel
毛飞龙3 小时前
Excel迷你图:在单元格中嵌入趋势洞察
excel·迷你图·sparklines
Tatalaluola3 小时前
Unity使用EPPlus读取写入表格
unity·c#·游戏引擎·excel
缺点内向6 小时前
如何在 C# 中将 Excel 工作表拆分为多个窗格
开发语言·c#·.net·excel
Williams1020 小时前
Java POI/Excel工具:终结OOM、精度丢失和i18n三大难题
java·开发语言·excel
开朗觉觉20 小时前
poi导出大量数据到Excel
windows·excel
dubochao_xinxi1 天前
fastapi 接收10g 以上的文件 pandas 读取超过 10GB 的 Excel 文件
excel·pandas·fastapi
Oll Correct2 天前
Excel基础操作(三)
笔记·excel
讓丄帝愛伱2 天前
excel导出实例
java·python·excel
Lilixxs2 天前
Excel VBA离线帮助文档下载和使用
excel·vba·帮助文档·ms help runtime·hxs