snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Sub SaveAllPdf()
Dim sFolderPath As String
Dim Path As String
Dim FName As String
On Error Resume Next
Application.ScreenUpdating = False
sFolderPath = "C:\" & "TestPDF"
If Dir(sFolderPath, vbDirectory) = "" Then
MkDir sFolderPath
End If
FName = "PrintTest"
Application.DisplayAlerts = False
ActiveWorkbook.ExportAsFixedFormat xlTypePDF, From:=1, To:=5, Filename:=sFolderPath & "\" & FName
Application.DisplayAlerts = True
Application.ScreenUpdating = True
If MsgBox("ส่งออกไฟล์ไปไว้ที " & sFolderPath & vbCrLf & "ต้องการเปิด Folder กด Yes ไม่ต้องการ กด No ", 36, "Open Folder") = 6 Then
ActiveWorkbook.FollowHyperlink Address:=sFolderPath, NewWindow:=True
End If
End Sub
You do not have the required permissions to view the files attached to this post.