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
相关推荐
Non-existent9878 分钟前
海拔批量查询 + 批量 KML 生成工具-WPS 插件 TableGIS 新功能
javascript·c++·excel·wps
Metaphor69220 小时前
使用 Python 在 Excel 文件中查找并替换
python·excel
xiaomin-Michael21 小时前
EXCEL pivot table
excel
包子源21 小时前
PDF 转 Word/Excel 全链路实战:Next.js + 阿里云文档智能
pdf·word·excel
Java知识技术分享1 天前
excel动态表头实现+异步使用
java·spring·excel
tedcloud1231 天前
academic-research-skills部署教程:构建AI辅助科研环境
服务器·人工智能·word·excel·dreamweaver
wtsolutions2 天前
Sheet-to-Doc Excel Add-in Released, Install Directly from Microsoft AppSource
microsoft·excel
开开心心就好2 天前
完美兼容Office格式的免费办公套件
windows·均值算法·计算机外设·word·excel·csdn开发云·图搜索算法
未来之窗软件服务2 天前
Excel 物流货运记账表模板【万象EXCEL(二十七)】—东方仙盟
excel·仙盟创梦ide·东方仙盟·万象excel