Consulting

Results 1 to 3 of 3

Thread: 1004 error

  1. #1
    VBAX Regular aoc's Avatar
    Joined
    Apr 2007
    Location
    Istanbul
    Posts
    90
    Location

    1004 error

    hi,

    when I run the code below I get

    1004 error " Method 'ActivePrinter' of object '_Application' failed "

    ?zerindeki is the turkish of on

    Sub ece()
    Application.ActivePrinter = "Ne02: ?zerindeki HP DeskJet 840C/841C/842C/843C "
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    End Sub

    what is the problem ?

  2. #2
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Err 1004 means the printer you specified doesn't exist. Try a one line macro
    debug.print application.activeprinter after you manually set your printer of
    choice to get the exact printer name.

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Try Application.ActivePrinter = "?zerindeki HP DeskJet 840C/841C/842C/843C on Ne02:"

    Have a look at this KB Item
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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