Hi all,
I'm writing a macro that will run a report in excel, save the excel worksheet and then print it to pdf. Everything works fine except the enter sendkey won't work. Does anyone know a better way then using sendkeys? The macro will run for over 100 accounts so I'd prefer to not have to press "enter" after each one runs. Below is the part of my code that saves & prints to pdf.
Thanks!
ActiveWorkbook.SaveAs (outpth & outname & "_" & tempstring & ".xls")
Application.ActivePrinter = "Adobe PDF on Ne06:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Adobe PDF on Ne06:", Collate:=True
SendKeys Filename & "{ENTER}", True
ActiveWorkbook.Close
I'm writing a macro that will run a report in excel, save the excel worksheet and then print it to pdf. Everything works fine except the enter sendkey won't work. Does anyone know a better way then using sendkeys? The macro will run for over 100 accounts so I'd prefer to not have to press "enter" after each one runs. Below is the part of my code that saves & prints to pdf.
Thanks!
ActiveWorkbook.SaveAs (outpth & outname & "_" & tempstring & ".xls")
Application.ActivePrinter = "Adobe PDF on Ne06:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Adobe PDF on Ne06:", Collate:=True
SendKeys Filename & "{ENTER}", True
ActiveWorkbook.Close