I solved my ask with the advice in the post. Thank you
I solved my ask with the advice in the post. Thank you
Last edited by Jennie82; 11-17-2021 at 11:41 AM. Reason: I solved my ask with the advice in the post. Thank you
Found a possible solution like this:
WBDPrivate Sub Com_Print_Click() Dim wb As Workbook Dim fn As String fn = Environ("USERPROFILE") & "\Desktop\" & txt_base.Text & " - " & txt_name.Text & " " & Format(Date, "yyyy-mm-dd") & " " & Format(Now, "hhmm") & ".pdf" ClientNote.PrintForm Application.ScreenUpdating = False Application.SendKeys "(%{1068})" DoEvents Set wb = Workbooks.Add ActiveSheet.PasteSpecial Format:="Bitmap" Selection.ShapeRange.Width = Range("A1:I1").Width ActiveSheet.Range("A1").Select ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fn wb.Close False Application.ScreenUpdating = True End Sub
Office 365 on Windows 11, looking for ✶ rep!
Oops. I think I left this line in there by accident. Please remove it:
WBDClientNote.PrintForm
Dear WideBoyDixon,
The workbook works well but I may need your help in 2 items .
If I would like to change the path of the final pdf file, how can I make it ? Example it will be some share folder ?
When I use the Print Button, the numlock of my Keyboard go inactive and I have to click it to activate. Is it because of the code ?
Thanks
Thu.
You can set the location of the file by changing this line:
So just put something like this:fn = Environ("USERPROFILE") & "\Desktop\" & txt_base.Text & " - " & txt_name.Text & " " & Format(Date, "yyyy-mm-dd") & " " & Format(Now, "hhmm") & ".pdf"
I have no idea about your NumLock issue - I can't see how the code would affect that.fn = "\\server\folder\" & txt_base.Text & " - " & txt_name.Text & " " & Format(Date, "yyyy-mm-dd") & " " & Format(Now, "hhmm") & ".pdf"
WBD
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks