Excel-VBA代码多个excel工作簿转PDF
1、打开VBA编辑器或按住Alt+F11
2、插入模块(右击插入或菜单栏插入)
3、右边代码编辑处输入VBA代码
4、VBA代码
Sub ConvertPDF() strPath = ThisWorkbook.Path & "\"
'定义当前工作簿路径
For Each s In Sheets
'遍历该路径下所有工作簿
If s.Name <> "当前excel名字" Then
'同路径下非当前工作簿
s.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
strPath & s.Name & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False,_
OpenAfterPublish:=False
End If
Next
End Sub
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:76
阅读量:62
阅读量:34
阅读量:87
阅读量:87