ExportAsFixedFormat cuts off Rows and Columns

cool1_boy1

New Member
Joined
Mar 19, 2013
Messages
21
I have a worksheet that I want to convert to PDF using ExportAsFixedFormat.
I have a subroutine, PrintSheet, that formats the sheet's margins, header/footer, etc.
If I print preview the sheet, everything looks great, but when I use ExportAsFixedFormat, the output PDF cuts off many rows and columns. Any suggestions?

Code:
Sub TestPrint()

    With ActiveWorkbook
        FileNameWithoutExtension = Left(.Name, (InStrRev(.Name, ".", -1, vbTextCompare) - 1))
        CurrentFolder = .Path & "\"
    End With


    With ActiveSheet
        Call PrintSheet(.Name)
        .Select
    End With
    
    With Selection
        .ExportAsFixedFormat Type:=xlTypePDF, Filename:=CurrentFolder & FileNameWithoutExtension & ".pdf" _
        , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
    End With


End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
K, I fixed it,
Code:
[COLOR=#333333]With Selection[/COLOR]
was selecting the cells to print. I wanted to print the entire worksheet.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top