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
相关推荐
米芝鱼10 小时前
Unity读取Excel转换为二进制数据文件与自定义数据读写
游戏·unity·游戏引擎·excel·urp
用户2986985301410 小时前
如何在 C# 中创建、读取和更新 Excel 文档
后端·c#·excel
艾上编程10 小时前
第一章——办公自动化之Excel批量合并工具:Python助力高效办公
开发语言·python·excel
MYX_30913 小时前
使用EXCEL进行数据清洗
excel
傻啦嘿哟13 小时前
Python高效实现Excel与TXT文本文件数据转换指南
开发语言·python·excel
綝~14 小时前
Excel导入MongoDB操作手册
数据库·excel
暗武逢天14 小时前
Java导出复杂Excel升级版(解决占位符遗留问题,通用工具类)
java·excel·easyexcel·模板导出·通用工具类
ohoy1 天前
EasyPoi 自定义数据处理
excel
ohoy2 天前
easypoi 自定义样式 学生-分数红绿颜色设置
excel
ranchor6662 天前
excel+pandas使用str.contains() 的典型例子
excel·pandas