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
相关推荐
二狗哈19 小时前
制作一款打飞机游戏23:编辑器ui
ui·编辑器·excel
CodeCraft Studio21 小时前
Excel处理控件Spire.XLS系列教程:Java设置Excel活动工作表或活动单元格
java·python·excel
CodeJourney.1 天前
深度探索:DeepSeek赋能WPS图表绘制
数据库·人工智能·算法·信息可视化·excel
努力的搬砖人.1 天前
在springboot项目中,如何进行excel表格的导入导出功能?
spring boot·后端·excel
java程序员CC1 天前
使用springboot+easyexcel实现导出excel并合并指定单元格
spring boot·后端·excel
我老菜2 天前
解析excel中的图片
java·excel
CodeCraft Studio2 天前
Excel处理控件Aspose.Cells教程:使用 Python 在 Excel 中进行数据验
开发语言·python·excel
时间之城2 天前
笔记:记一次使用EasyExcel重写convertToExcelData方法无法读取@ExcelDictFormat注解的问题(已解决)
java·spring boot·笔记·spring·excel
VBAMatrix2 天前
审计效率升级!快速匹配Excel报表项目对应的Word附注序号
excel·审计·财务报表·会计师事务所·审计工具
lovely_nn2 天前
wps excel 常用操作
excel·wps