Share via

Excel.Application.ActivePrinter won't work in Windows 7 (Enterprise)

Anonymous
2011-09-02T00:49:18+00:00

Work refreshed our computers (Dell Optiplex 790), and some of my custom code doesn't work anymore. Specifically: Excel.Application.ActivePrinter was used to toggle between two printers for output. I don't get any error messages, but it will not change the default printer on command. This used to work fine with the old machine running XP. Here is the code I used in the past. There is a lot more to my project, but this is my development code. All librarys appear to be present and referenced.

Private Sub Printer1_Click()

On Error Resume Next

 Excel.Application.ActivePrinter = "ZDesigner 110XiIII Plus (300DPI) on Ne01:"

 Excel.Application.ActivePrinter = "ZDesigner 110XiIII Plus (300DPI) on Ne00:"

On Error Resume Next

 Excel.Application.ActivePrinter = "ZDesigner 110XiIII Plus (300DPI) on Ne00:"

 Excel.Application.ActivePrinter = "ZDesigner 110XiIII Plus (300DPI) on Ne01:"

MsgBox "The name of the active printer is " & _

    Excel.Application.ActivePrinter

End Sub

Private Sub Printer2_Click()

On Error Resume Next

 Excel.Application.ActivePrinter = "WA07PRLBP25989 Bldg 6-Room 4-Pure Metals on Ne00"

 Excel.Application.ActivePrinter = "WA07PRLBP25989 Bldg 6-Room 4-Pure Metals on Ne01"

On Error Resume Next

 Excel.Application.ActivePrinter = "WA07PRLBP25989 Bldg 6-Room 4-Pure Metals on Ne01"

 Excel.Application.ActivePrinter = "WA07PRLBP25989 Bldg 6-Room 4-Pure Metals on Ne00"

MsgBox "The name of the active printer is " & _

    Excel.Application.ActivePrinter

End Sub

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
    2011-09-10T15:10:12+00:00

    For the most part, you're not talking to Microsoft here, you're with other users like yourself, folks either looking for answers or volunteering to try to provide them.

    If you've found a workaround for the problem, please do explain it here so others can benefit.

    Thanks.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2011-09-10T12:52:30+00:00

    Thanks Microsoft for not enhancing your software, but limiting its ability to do the job. I found a suitable workaround so you can continue sleeping, or making more of those useless software changes that make computing even more of a hassle then it used to be!

    Was this answer helpful?

    0 comments No comments