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
相关推荐
Hello.Reader26 分钟前
Flink 系统内置函数(Built-in Functions)分类、典型用法与选型建议
大数据·flink·excel
彭于晏Yan7 小时前
excel导入导出
spring boot·excel
lbb 小魔仙9 小时前
Python 读取 Excel 文件:openpyxl 与 pandas 实战对比
python·excel·pandas
徐赛俊10 小时前
# Excel 图表自动变色教程(基于控制单元格)
excel
2501_9307077810 小时前
如何使用C#代码将 Excel 中的图表转换为图片
excel
娃乐呵1 天前
免费的大批量Excel文档大模型处理数据工具
语言模型·大模型·excel·数据处理
Eiceblue1 天前
使用 Python 写入多类型数据至 Excel 文件
开发语言·python·excel
蹦蹦跳跳垂耳兔1 天前
Excel创建组妙用隐藏
excel
开开心心_Every1 天前
无广告干扰:简单好用文字LOGO设计工具
xml·java·网络·数据库·华为od·华为云·excel
CodeCraft Studio2 天前
Excel处理控件Aspose.Cells教程:使用C#在Excel中创建气泡图
信息可视化·c#·excel·aspose·excel api库·excel气泡图·excel组件库