This little macro will PDF-print and save with filename= Cell A8 value. A value that change before the next print. Usually every thing work fine but once in a while, for a reason I would like to know, the sytem call for a filename input instead of reading it from cell A8. Then, without any change, the macro work fine again. Any hint?
Thanks!
Sub printPDF()
Dim strOldPrinter As String
'save default printer string
strOldPrinter = Application.ActivePrinter
Application.SendKeys "{return}" & Range("a8") & "{return}", True
Application.Dialogs(xlDialogPrint).Show
'restore old printer string
End sub
Thanks!
Sub printPDF()
Dim strOldPrinter As String
'save default printer string
strOldPrinter = Application.ActivePrinter
Application.SendKeys "{return}" & Range("a8") & "{return}", True
Application.Dialogs(xlDialogPrint).Show
'restore old printer string
End sub