Results 1 to 1 of 1

Network printing problem

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Angry Network printing problem

    Hello all,

    I am trying to figure out why this code is not working properly on my bosses computer, but works just fine off of my computer. The file is located on a shared drive, so I am not understanding why. Don't know if anyone has ever experienced this at their work place before, if so, your assistance would be greatly appreciated.

    Attached is the VBA I use to print a worksheet. It will ask what printer the user would like to use and the default on both our machines is the same.
    It throws a runtime error of 1004 on this line - Application.ActivePrinter = "\\wshps4\ghcolor on Ne03:"
    Here goes:
     Sub PrintSheet1()
    
       Dim Answer As String
       Dim Response As Integer
     
         Answer = "Do you want to print in color?"
         Response = MsgBox(Answer, vbQuestion + vbYesNoCancel, "???")
         If Response = Cancel Then Exit Sub
         
         If Response = vbYes Then
               Copies = Application.InputBox("How many copies do you wish to print?", Type:=1)
           If Copies < 1 Then Copies = 1
            Sheets("Employee Hours Week2").Select
             Range("A2:h41").Select
            Application.ActivePrinter = "\\wshps4\ghcolor on Ne03:"
             ActiveWindow.Selection.PrintOut Copies:=Copies, Collate:=True, ActivePrinter:="\\wshps4\ghcolor on Ne03:"
         Else
           If Response = vbNo Then
           Answer = "Do you want Black and White copies?"
           Response = MsgBox(Answer, vbQuestion + vbYesNo, "???")
           If Response = vbNo Then Exit Sub
           If Response = vbYes Then
           Copies = Application.InputBox("How many copies do you wish to print?", Type:=1)
           If Copies < 1 Then Copies = 1
             Sheets("Employee Hours Week2").Select
             Range("A2:h41").Select
             Application.ActivePrinter = "\\WSHPS4\A066 on Ne02:"
             ActiveWindow.Selection.PrintOut Copies:=Copies, Collate:=True, ActivePrinter:="\\WSHPS4\A066 on Ne02:"
         End If
         End If
         End If
         
     End Sub
    Last edited by Leith Ross; 04-03-2012 at 02:44 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1