标签:filename pre eth vba .com PDF文件 转化 ali each
将工作薄每一个工作表导出为PDF文件。
Sub aliensky() Dim asy As Worksheet Dim spath As String spath = Excel.ThisWorkbook.Path For Each asy In Excel.ThisWorkbook.Worksheets sName = spath & "\" & asy.Name & ".pdf" asy.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sName Next End Sub
将当前工作表导出为PDF文件。
Sub aliensky1() spatch = Excel.ThisWorkbook.Path sName = spatch & "\" & ActiveWorkbook.Name & ".pdf" ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sName End Sub
VBA 参考文档
https://msdn.microsoft.com/zh-cn/VBA/Excel-VBA/articles/workbook-exportasfixedformat-method-excel
标签:filename pre eth vba .com PDF文件 转化 ali each
原文地址:https://www.cnblogs.com/aliensky/p/9622682.html