excel中html批量转化为pdf|excel中html批量转化为pdf,批处理|批量将EXCEL转为PDF

Sub 打印为一个PDF()
Dim MyPath As String, MyName As String
MyPath = ThisWorkbook.Path & "\"
MyName = Dir(MyPath & "*.xls") '将需要打印的表格放在代码表格同目录下,取文件名
Application.ScreenUpdating = False
Do While MyName <> ""
If MyName <> ThisWorkbook.Name Then
【excel中html批量转化为pdf|excel中html批量转化为pdf,批处理|批量将EXCEL转为PDF】Set wb = GetObject(MyPath & MyName) 'getobject隐式打开excel
For i = 1 To wb.Worksheets.Count
wb.Worksheets(i).Visible = -1 '显示隐藏的worksheet
Next
wb.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
MyPath & MyName & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:= _
True, IgnorePrintAreas:=False, OpenAfterPublish:=False
'上述几行代码为录制宏得到,也是核心代码
wb.Close False
Set wb = Nothing
End If
MyName = Dir
Loop
Application.ScreenUpdating = True
MsgBox "完毕"
End Sub

    推荐阅读