Hi all,
I have a workbook that runs a macro to fill in a "label" which is just a separate worksheet within the workbook that is formatted to a certain label size. It also prints that "label" out to a Dymo label printer that is set up as a network printer. This all works great, except sometimes a default setting in our Dymo Label Printer will get changed, so when the macro is ran to print the label it prints the wrong size out and usually way to many labels because the print area is not correct. What can i put in my code so that it always checks/changes to the correct label size, and "landscape" orientation BEFORE it prints out? There are too many users and computers to go around and make sure everybody's default is set correctly. Could anyone help me out? Below is the code, thanks!
Also looking at the current code i have, is there a shorthand way to write the code pertaining the:
and all the other Ne options that it has to check?
I have a workbook that runs a macro to fill in a "label" which is just a separate worksheet within the workbook that is formatted to a certain label size. It also prints that "label" out to a Dymo label printer that is set up as a network printer. This all works great, except sometimes a default setting in our Dymo Label Printer will get changed, so when the macro is ran to print the label it prints the wrong size out and usually way to many labels because the print area is not correct. What can i put in my code so that it always checks/changes to the correct label size, and "landscape" orientation BEFORE it prints out? There are too many users and computers to go around and make sure everybody's default is set correctly. Could anyone help me out? Below is the code, thanks!
Also looking at the current code i have, is there a shorthand way to write the code pertaining the:
Code:
Const MyPrinter As String = "DYMO LabelWriter 450 Twin Turbo on Ne00:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
and all the other Ne options that it has to check?
Code:
Sub printlabel()
Dim sCurrentPrinter As String
Const MyPrinter As String = "DYMO LabelWriter 450 Twin Turbo on Ne00:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne01:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne02:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne03:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne04:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne05:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne06:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne07:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne08:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne09:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = "DYMO LabelWriter 450 Twin Turbo on Ne10:"
sCurrentPrinter = Application.ActivePrinter
On Error Resume Next
Application.ActivePrinter = MyPrinter
Sheets("Label").PrintOut
Application.ActivePrinter = sCurrentPrinter
End Sub