You need to pass the
PrToFileName
and
PrintToFile
parameters to
the PrintOut
method[
^]:
Dim fullPath As String = System.IO.Path.GetFullPath(FileName)
oSheet.PrintOut(copies:=1, Preview:=True, ActivePrinter:="Microsoft Print To PDF", PrToFileName:=fullPath, PrintToFile:=True)