Results 1 to 2 of 2

Assigning Application.ActivePrinter

Threaded View

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    Harrison, MI
    MS-Off Ver
    Excel 2000
    Posts
    13

    Assigning Application.ActivePrinter

    This "don't" compute.
    =====
       Dim Ans As String
       Dim Data_Assigned_Printer As String
    '  =====================
    '  This works 
    '  =====================
        Ans = InputBox("Which Printer 1-2-3")
         If Ans = "1" Then
            Application.ActivePrinter = "Canon MX430 series Printer on Ne08:"
            ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
                "Canon MX430 series Printer on Ne08:", Collate:=True
        ElseIf Ans = "2" Then
            Application.ActivePrinter = "CutePDF Writer on CPW2:"
            ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
                "CutePDF Writer on CPW2:", Collate:=True
        ElseIf Ans = "3" Then
            Application.ActivePrinter = "PDFCreator on Ne02:"
            ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
                "PDFCreator on Ne02:", Collate:=True
        End If
    '  =====================
    '  This does not work
    '  =====================
        If Data_Assigned_Printer <> "" Then Application.ActivePrinter = Data_Assigned_Printer
    '  =====================
    '  The value in Data_Assigned_Printer was copied from value above in Debug Mode
    '  Runtime errir '1004':
    '  Method 'ActivePrinter' of object '_Application' failed
    '  ?????
    '  =====================
    Sorry my indentations in code did not come through in the post so it is a bit more difficult to read. Any help would be GREATLY appreciated.
    Dan F.
    Last edited by arlu1201; 03-01-2013 at 09:35 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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