Hi,
I have the following code which at the click of a button saves my excel file to a pdf into a given folder location. The code works perfectly but i would like to take it a step further and either, prior to saving or after saving to pdf, print the document at the click of the same button. The file is used over a network and therefore has multiple users whom are all mapped to different printers. Are you able to print to your default printer based on who's using the file?
Your help would be very much appreciated.
Many thanks
I have the following code which at the click of a button saves my excel file to a pdf into a given folder location. The code works perfectly but i would like to take it a step further and either, prior to saving or after saving to pdf, print the document at the click of the same button. The file is used over a network and therefore has multiple users whom are all mapped to different printers. Are you able to print to your default printer based on who's using the file?
Your help would be very much appreciated.
Code:
Sub CentreSoft()
Dim vDir
pdfname = ActiveSheet.Range("X20")
vDir = "\\cdhnas\cdh\Centresoft\Coding Forms PDF\CentreSoft"
fileSaveName = vDir & pdfname
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fileSaveName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox "PDF File Saved (Centresoft\Coding Forms PDF\CentreSoft)"
End Sub
Many thanks
Last edited by a moderator: