I created the macro below to allow users to generate a PDF of the worksheet (it's a form that will be used to obtain an electronic signature in a system that places the signature and additional comments in a particular location referenced to the bottom of the page). The problem is that when I test it the resulting .pdf is an 8.5" x 11" document but when other users use it the resulting document size varies. I've seen 9.55" x 12.36" and 8.27" x 11.69". Does anyone know how to control this? Does it, perhaps, depend on what PDF converter add-in people have installed? I am in Canada. The problem seems to occur mainly with users in India.
Sub Create_PDF()
'
' Create_PDF Macro
' Print to .pdf with appropriate filename.
'
' Keyboard Shortcut: Ctrl+p
Dim theName As String
theName = Range("C1") & "" & Range("A1").Value & " SOC"
ActiveSheet.PageSetup.PaperSize = xlPaperLetter
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=theName, Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Bookmarks