How do I prevent pdf from opening when doing a saveas?

Here is my line of code.

The pdf still opens even with the silent option.

   boolstatus = swModelDocExt.SaveAs(PdfFilePath, 0, swSaveAsOptions_e.swSaveAsOptions_Silent, swExportPDFData, lErrors, lWarnings)

Recommendations?

I have discovered the reason.

I did a save as through Solidworks UI and noticed a check box. "View PDF after saving" I deselected this and pdf no longer pops up.

I guess the API silent option is overridden by the Save as Checkbox.

Message was edited by: Lyndon Crossman

SolidworksApi macros