Print pdf in folder on pc

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,

I have a YES / NO message box code in use as shown below.

I need to add a code for when i select NO as opposed the current EXIT SUB

My invoice is taken from worksheet INV & in cell L4 is the invoice number
The pdf is saved like so 123.pdf
The folder path for where it is saved is C:\Users\Ian\Desktop\REMOTES ETC\DR\DR COPY INVOICES

My goal is when a user selects NO the code should print the invoice in question so this example is 123.pdf from path supplied.
If its not possible then just open the pdf so i manually the select print

Thanks


Rich (BB code):
   answer = MsgBox("INVOICE HAS NOW BEEN SAVED" & vbNewLine & vbNewLine & "DID THE INVOICE PRINT OK FOR YOU ?", vbInformation + vbYesNo, "INVOICE PRINT OK MESSAGE")
    If answer = vbNo Then
    Exit Sub
    Else
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I have managed this so far.
My question is,
When it prints will it print whats on the excell page or the pdf file ?
Im expecting it to be the pdf file
Please advise.



Rich (BB code):
      answer = MsgBox("INVOICE HAS NOW BEEN SAVED" & vbNewLine & vbNewLine & "DID THE INVOICE PRINT OK FOR YOU ?", vbInformation + vbYesNo, "INVOICE PRINT OK MESSAGE")
    If answer = vbNo Then
    VBA.Shell "explorer.exe /select, " & "" & strFileName & "", vbNormalFocus
    .PrintOut copies:=1
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,123,009
Members
449,093
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top