Diamondeffect
New Member
- Joined
- Jun 16, 2014
- Messages
- 5
Hi All,
I have recently written some excel code (mostly borrowed from the internet) to print a range of hidden sheets through a PDF printer (doPDF) for a document used by several members of my team (who use the company network). When we used Version 7 it worked fine but since some people moved to version 8 of doPDF it keeps failing.
The code I am using is:
Sub Select_page_only()
If IsEmpty(ActiveSheet.Range("G2")) Then
MsgBox ("Please enter a company/customer name!")
Exit Sub
End If
If ActiveSheet.Range("J20").Value = "CHECK" Then
MsgBox ("Please check handset price!")
Exit Sub
End If
Application.ScreenUpdating = False
Application.ActivePrinter = "doPDF v7 on DOP7:"
With Sheets("Printable Document")
.Visible = True
.PrintOut From:=3, To:=3, Copies:=1, Collate:=True
.Visible = False
End With
Application.ScreenUpdating = True
End Sub
It is the line in red I have an error on (DOP7 is the old printer port) but when I change it to the listed port for version 8 it will not work and suggests I use Ne01 when changing doPDF 8 to the active printer. However everyone has a different network port (Ne02, Ne03 etc) and I cannot seem to figure out how to unify this or why the previous method will simply not work when modified.
I am very new to all this so any help will be hugely apprieciated
I have recently written some excel code (mostly borrowed from the internet) to print a range of hidden sheets through a PDF printer (doPDF) for a document used by several members of my team (who use the company network). When we used Version 7 it worked fine but since some people moved to version 8 of doPDF it keeps failing.
The code I am using is:
Sub Select_page_only()
If IsEmpty(ActiveSheet.Range("G2")) Then
MsgBox ("Please enter a company/customer name!")
Exit Sub
End If
If ActiveSheet.Range("J20").Value = "CHECK" Then
MsgBox ("Please check handset price!")
Exit Sub
End If
Application.ScreenUpdating = False
Application.ActivePrinter = "doPDF v7 on DOP7:"
With Sheets("Printable Document")
.Visible = True
.PrintOut From:=3, To:=3, Copies:=1, Collate:=True
.Visible = False
End With
Application.ScreenUpdating = True
End Sub
It is the line in red I have an error on (DOP7 is the old printer port) but when I change it to the listed port for version 8 it will not work and suggests I use Ne01 when changing doPDF 8 to the active printer. However everyone has a different network port (Ne02, Ne03 etc) and I cannot seem to figure out how to unify this or why the previous method will simply not work when modified.
I am very new to all this so any help will be hugely apprieciated