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
相关推荐
珍朱(珠)奶茶14 小时前
Spring Boot3整合Jxls工具包实现模版excel导出文件
spring boot·后端·excel
辉博士16 小时前
Spring Boot+EasyExcel实现Excel文件
java·spring boot·excel
Teable任意门互动16 小时前
多维表格本地化部署实践解析 企业如何实现数据自主可控路径
数据库·excel·钉钉·飞书·开源软件
Eiceblue17 小时前
Python 如何实现 Excel 数据分列?一列拆分为多列
python·microsoft·excel
许杰小刀17 小时前
使用 Python 将 Excel 数据批量导入到数据库中(SQLite)
数据库·python·excel
2501_930707781 天前
使用C#代码在 Excel 中添加或设置批注格式
excel
梦因you而美1 天前
Python win32com 复制Excel sheet优化:覆盖替换而非删除重建,彻底解决公式报错
python·excel·win32com·python自动化·批量复制sheet表
asdzx671 天前
使用 C# 将 Excel 转换成高质量 JPG
开发语言·c#·excel
城数派1 天前
2014-2025年全国监测站点的逐月空气质量数据(15个指标\Excel\Shp格式)
arcgis·信息可视化·数据分析·excel
Metaphor6922 天前
使用 Python 操作 Excel 文件中的工作表(添加和删除)
python·excel