This one should be easy, but I can't fix it and am asking for help.
I have a client that wants to be able to publish *.pdf versions of select sheets within the workbook. Two worksheets have overlapping charts on them. The charts, when I push to *.pdf, do not line up. (In fact, they look odd, with axis, labels, etc. out of place)
I can push a chart to a Chart1 page, but I have overlapping charts (I show an overlay on an earned value progression chart).
Here's the simple code:
msg = "Publish to PDF format?"
Dialogstyle = vbQuestion + vbYesNo
Title = "Save *.pdf Report"
RESPONSE = MsgBox(msg, Dialogstyle, Title)
If RESPONSE = vbYes Then
FileName1 = InputBox("Please input filename", "Filename", ProjectName & Month(Date) & "-" & Day(Date) & ".pdf")
' I was able to export, as an image, the single chart. It looks okay as an image
ActiveWorkbook.Charts(1).Select
ActiveChart.Export "test.png"
' This doesn't work, and I know why:
'ActiveWorkbook.Sheets("A_2-ExecWorkChart").Select
'ActiveSheet.Export "test2.png"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
FileName1 _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End If
'This seems extra:
If RESPONSE = vbNo Then
End If
Bookmarks