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
相关推荐
夜流冰6 小时前
Excel - MS Support for Excel: 2 Collaborate
数据库·windows·excel
LingRannn14 小时前
【vim 中如何替换】
编辑器·vim·excel
yesyesido15 小时前
智能文件格式转换器:文本/Excel与CSV无缝互转的在线工具
开发语言·python·excel
开开心心_Every1 天前
免费进销存管理软件:云端本地双部署
java·游戏·微信·eclipse·pdf·excel·语音识别
Kasen's experience1 天前
Excel 怎么快速合并同一个ID不同行的大量相同单元格
excel
mudtools1 天前
基于.NET操作Excel COM组件生成数据透视报表
c#·.net·excel
yangminlei2 天前
Spring Boot+EasyExcel 实战:大数据量 Excel 导出(高效无 OOM)
spring boot·后端·excel
NignSah2 天前
Microsoft Excel World Championship 2025-2025EXCEL大赛,折纸
microsoft·excel
hhzz2 天前
Springboot项目中使用POI操作Excel(详细教程系列1/3)
spring boot·后端·excel·poi·easypoi
林月明2 天前
【VBA】点击一个按钮实现自动更新excel文件列数据
excel·vba·宏文件·一键数据更新