Link to home
Start Free TrialLog in
Avatar of majervis
majervisFlag for United States of America

asked on

MS Excel Macro to print to PDF and save to a certain file name and overright it if necessary

I have included a recorded VBA macro that seems to choose PDF as my print option, but then I am asked for a file name.  Is there a way to modify what I have included to save to a file in a particular folder and replace if nesseary.  Many thanks!
Sub Print_to_PDF()
'
' Print_to_PDF Macro
'

'
    Application.ActivePrinter = "Adobe PDF on Ne06:"
    ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""Adobe PDF on Ne06:"",,TRUE,,FALSE)"
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of majervis

ASKER

Exactly what I was looking for.  Thank you for the fast reply.