G
Guest
Hello,
I have a macro that works. The issue I am having is it changes my default
printer. In the macro, I call upon the Microsoft Document driver to speed up
the macro. By doing this, it changes the printer for Excel to this Document
Driver. What code can I use to call upon the previous printer (what ever the
user's default printer is) so that when they print through Excel it will be
back to the default printer. Here is my code (condensed for easier reading):
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Addon()
'
' Addon Macro
' Addon recorded 2/6/2004 by bhodge
'
'
Application.EnableEvents = False
On Error Resume Next
Application.ActivePrinter = "Microsoft Office Document Image Writer on
Ne02:"
If Err.Number = 1004 Then
Application.ActivePrinter = "Microsoft Office Document Image Writer on Ne01:"
Err.Clear
End If
Dim AWB As Workbook
Set AWB = ActiveWorkbook
Application.ScreenUpdating = False
AWB.Activate
Workbooks.Open Filename:= _
"G:\Contract QuoteTemplates\Email Template Macro3l.xls"
AWB.Activate
Windows("Email Template Macro3l.xls").Activate
Sheets("Features").Select
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Move after:=Sheets(2)
Sheets("Sheet1").Name = "Terms and Conditions"
AWB.Activate
Sheets("Terms and Conditions").Select
Cells.Select
Selection.Copy
Application.ScreenUpdating = True
Range("a25").Select
Application.EnableEvents = True
RemoveAllCode
End With
End Sub
I have a macro that works. The issue I am having is it changes my default
printer. In the macro, I call upon the Microsoft Document driver to speed up
the macro. By doing this, it changes the printer for Excel to this Document
Driver. What code can I use to call upon the previous printer (what ever the
user's default printer is) so that when they print through Excel it will be
back to the default printer. Here is my code (condensed for easier reading):
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Addon()
'
' Addon Macro
' Addon recorded 2/6/2004 by bhodge
'
'
Application.EnableEvents = False
On Error Resume Next
Application.ActivePrinter = "Microsoft Office Document Image Writer on
Ne02:"
If Err.Number = 1004 Then
Application.ActivePrinter = "Microsoft Office Document Image Writer on Ne01:"
Err.Clear
End If
Dim AWB As Workbook
Set AWB = ActiveWorkbook
Application.ScreenUpdating = False
AWB.Activate
Workbooks.Open Filename:= _
"G:\Contract QuoteTemplates\Email Template Macro3l.xls"
AWB.Activate
Windows("Email Template Macro3l.xls").Activate
Sheets("Features").Select
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Move after:=Sheets(2)
Sheets("Sheet1").Name = "Terms and Conditions"
AWB.Activate
Sheets("Terms and Conditions").Select
Cells.Select
Selection.Copy
Application.ScreenUpdating = True
Range("a25").Select
Application.EnableEvents = True
RemoveAllCode
End With
End Sub