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
相关推荐
Eiceblue1 天前
使用 C# 将 Excel 转换为 Markdown 表格(含批量转换示例)
开发语言·c#·excel
Java面试题总结1 天前
使用 Python 设置 Excel 数据验证
开发语言·python·excel
追逐梦想永不停1 天前
记录一个好用的excel判断数字格式的公式
前端·chrome·excel
Eiceblue1 天前
C# 如何实现 Word 转 Excel ?分享两种实用方法
c#·word·excel
CircleMouse2 天前
如何设置wps单元格下拉选项设置
excel·wps
zhangjin12222 天前
kettle插件-excel插件,kettle读取excel动态表头,kettle根据列名读取excel
excel·kettle·kettle excel插件·kettle 动态excel
远洪3 天前
excel 找出两列不同的数据
excel
pcplayer3 天前
非常好用的 Excel 读写控件
excel·delphi·office
Navicat中国3 天前
使用 Navicat 导入向导导入 Excel 数据时,系统提示导入成功,表中也能看到数据,但行数统计显示为 0,这是什么原因?
数据库·excel·导入
穿着内裤的外星人3 天前
触控精灵远程读写Excel步骤配置
excel