Hi, I've tried the below code to print my file in pdf, unfortunately code not works at file name. Pls. guide me if anyone of you know how to rectify this.
Sub PRINT_PDF()
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="CutePDF Writer on CPW2:", Collate:=True
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
WaitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait WaitTime
Filename="D:\MIS Reports\" & Date & ".pdf"
SendKeys Filename & "{Enter}", False
Application.ScreenUpdating = True
End Sub
Sub PRINT_PDF()
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="CutePDF Writer on CPW2:", Collate:=True
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
WaitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait WaitTime
Filename="D:\MIS Reports\" & Date & ".pdf"
SendKeys Filename & "{Enter}", False
Application.ScreenUpdating = True
End Sub