Share via

Excel creating partial graphs when saving PDFs

Anonymous
2023-02-04T23:13:36+00:00

I am having the same issue as discussed in THIS THREAD.

When saving graphs as PDFs with Excel displayed on my extended large 24" HP monitor, the graphs are clipped to show only about the left/upper 2/3rds.

I even created a new workbook with similar graphs and it did it there too. It comes out the same when I use print to MS PDF.
When saving graphs as PDFs with Excel displayed on my smaller HP Spectre laptop 13.3" monitor, the graphs come out perfect.

I use MS 365, so I automatically have the latest version.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2023-02-06T13:38:10+00:00

    Hi,

    scenario:

    export chart from the active sheet to pdf , paper A4

    vba code

    Sub ActiveChart_to_PDF_A4()

    '## 06-Feb-2023 ##

    Dim ws As Worksheet

    Set ws = ActiveSheet

    Dim sPath As String

    sPath = ThisWorkbook.Path & ""

    Dim obj As ChartObject

    Dim sh As Shape

    Dim objName As String, sAdr As String, s1 As String, s2 As String

    Set obj = ws.ChartObjects(1)

    objName = obj.Name

    Application.ScreenUpdating = False

    Sheets.Add

    With ActiveSheet.Cells

    .RowHeight = 2

    .ColumnWidth = 0.2

    End With

    obj.CopyPicture

    ActiveSheet.Paste

    Set ws = ActiveSheet

    Set sh = ws.Shapes(1)

    sh.Width = Application.InchesToPoints(11.6)

    sh.Height = Application.InchesToPoints(8)

    s1 = sh.TopLeftCell.Address

    s2 = sh.BottomRightCell.Address

    sAdr = s1 & ":" & s2

    With ws.PageSetup

    .PrintArea = sAdr

    .LeftMargin = Application.InchesToPoints(0)

    .RightMargin = Application.InchesToPoints(0)

    .TopMargin = Application.InchesToPoints(0)

    .BottomMargin = Application.InchesToPoints(0)

    .HeaderMargin = Application.InchesToPoints(0)

    .FooterMargin = Application.InchesToPoints(0)

    .PaperSize = xlPaperA4

    .Zoom = False

    .FitToPagesTall = 1

    .FitToPagesWide = 1 '

    .CenterHorizontally = True

    .CenterVertically = True

    .Orientation = xlLandscape

    End With

    ws.ExportAsFixedFormat xlTypePDF, Filename:=sPath & Format(Date, "yyyymmdd-") & objName & ".pdf", OpenAfterPublish:=True

    Application.DisplayAlerts = False

    ws.Delete

    Application.DisplayAlerts = True

    Application.ScreenUpdating = True

    End Sub

    ==========================

    step1

    Save  your Workbook with extension .xlsm (macros enabled workbook)

    Step2

    2a) press ALT+F11 to open Visual Basic

    2b) from the ribbon, select: Insert > Module and paste the code above on the right 

    2c) Press ALT+Q to Close Visual Basic

    Step3

    To run the macro, press ALT+F8, 

    select '**ActiveChart_to_PDF_A4'**from the list and click the run button.

    or

    add a button and assign the  vba macro

    Was this answer helpful?

    0 comments No comments
  2. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2023-02-06T04:58:20+00:00

    Not having the problem is MS's (and your) job.

    I'm just here for fun because Excel is my hobby. I am not paid for my work here. .-)

    Andreas.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-02-05T21:06:49+00:00

    )-:

    "This sounds like a "bug". I will forward to..."
    would have been a better response.

    I know how to "get around" the problem; Not having the problem is MS's (and your) job.

    Was this answer helpful?

    0 comments No comments
  4. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2023-02-05T08:24:53+00:00

    If so, all you can do is send a frown. Or try a different PDF printer, there are several tools available on the web.

    We do not collect or report bugs here. This is an answers forum, we help users to achieve there concerns.
    I you want to report a bug please have a look here:

    How do I give feedback on Microsoft Office? - Office Support

    Andreas.

    Was this answer helpful?

    0 comments No comments