justanotheruser
Board Regular
- Joined
- Aug 14, 2010
- Messages
- 96
Hi all,
I'm using this code to print a sheet using VBA to a specific printer, called Lexmark E350d:
<CODE>Sub MyPrint()
Dim sCurrentPrinter As String
Const MyPrinter As String = "Lexmark E350d"
sCurrentPrinter = ActivePrinter
ActivePrinter = MyPrinter
ActiveSheet.PrintOut '<can change to specific sheet
ActivePrinter = sCurrentPrinter
End Sub</CODE>
Upon executing the code, I get Run-time error '1004': Method 'ActivePrinter' of object '_Global' failed - what does this error mean, debugging highlights the code highlighted in blue above. Thanks in advance!
I'm using this code to print a sheet using VBA to a specific printer, called Lexmark E350d:
<CODE>Sub MyPrint()
Dim sCurrentPrinter As String
Const MyPrinter As String = "Lexmark E350d"
sCurrentPrinter = ActivePrinter
ActivePrinter = MyPrinter
ActiveSheet.PrintOut '<can change to specific sheet
ActivePrinter = sCurrentPrinter
End Sub</CODE>
Upon executing the code, I get Run-time error '1004': Method 'ActivePrinter' of object '_Global' failed - what does this error mean, debugging highlights the code highlighted in blue above. Thanks in advance!
Last edited: