I am not an expert in vba and with the forum guide created userform and works well.
I want to save the userform in pdf with textbox file name which i am trying for the past 2 days and unsuccessful.
advice requested.
my code
Everytime when print, it prompts for "Microsoft Visual Basic" as file name instead of the given file name.
Help please!
I want to save the userform in pdf with textbox file name which i am trying for the past 2 days and unsuccessful.
advice requested.
my code
Code:
Dim OldPrinter As String, NewPrinter As String OldPrinter = Left$(Application.ActivePrinter, InStrRev(Application.ActivePrinter, "on ") - 2)
Application.Dialogs(xlDialogPrinterSetup).Show
NewPrinter = Left$(Application.ActivePrinter, InStrRev(Application.ActivePrinter, "on ") - 2)
Dim sFilename As String
Dim cname, tagNumber, customer, newHour, newMinute, newSecond, waitTime
Dim fpath As String
With rvcform
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
cname = NO.Value
tagNumber = TAGN.Value
customer = CUSTO.Value
sFilename = customer & "-RVC-" & cname & "-" & tagNumber & ".pdf"
fpath = "C:\Users\VSD\Desktop\RVC_Printed_Copies\"
Application.ScreenUpdating = True
SendKeys fpath & sFilename & "{ENTER}", False
MsgBox fpath & sFilename
.PrintForm
End With
Everytime when print, it prompts for "Microsoft Visual Basic" as file name instead of the given file name.
Help please!