I use the following routine to export (save) a chartsheet as pdf. The function gets the names of the user selected chartsheets in a collection. Then it exports one by one as a pdf where the user can select the save folder of the exported pdf. Here my code.
Private Function ExportCurvesPDF(Curves As Collection)
Dim source As Workbook
Dim i As Integer
Dim FileName As String
Dim ExportPath As String
Set source = Thisworkbook
ExportPath = "V:\"
For i = 1 To Curves.count
FileName = Application.GetSaveAsFilename(ExportPath & Curves(i) & ".pdf")
If FileName <> "False" Then
source.Sheets(Curves(i)).ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End If
ExportPath = common_DB.FolderFromPath(FileName)
Next i
End Function
The code works as expected and prints out the pdfs as an example below:
The pdf has quite the margin though and I want to reduce or remove it. I have tried to change the IgnorePrintArea property and the IncludeDocProperties property but nothing seems to have an effect on the margin.
Is there a way to reduce the margin with the .ExportAsFixedFileFormat ?
EDIT: I was asked to provide a screenshot of how the chart looks in excel:





