ExportAsFixedFormat produces huge page sizes

F

Fred Z

Hi,

I've googled around quite a bit and determined that there is (or was)
a known problem with ExportAsFixedFormat which causes Excel to create
PDFs with very large page sizes (e.g 20 x 15), apparently ignoring all
directives re page size and zoom.

this is causing me a lot of heartburn as it is the only remaining flaw
in a script that I have set up to automate a critical business process
by producing regular PDF reports.

I would really appreciate it if anyone would take a look and see if
they can help me trouble shoot.

here is the entire script.

Sub PrintEachCurrentRowToPDF()

Dim MyDateCheck As String
Dim MyFileNamePrefix As String
Dim MyFileNameSuffix As String
Dim MyFileName As String

Worksheets("Sheet1").PageSetup.PaperSize = xlPaperLegal

For i = 396 To 999 Step 1
Rows(1).Select
Rows(i).Select

MyDateCheck = Worksheets("Sheet1").Cells(i, 5)
MyFileNamePrefix = Worksheets("Sheet1").Cells(i, 4)
MyFileNameSuffix = Worksheets("Sheet1").Cells(i, 2)
MyFileName = MyFileNamePrefix + MyFileNameSuffix

If MyDateCheck = "5/1/2009" Then

Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=MyFileName,
Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas:=False, OpenAfterPublish:=True

Else
End If
Next i

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top