+ Reply to Thread
Results 1 to 6 of 6

Printer.Print Not Working?

  1. #1
    Registered User
    Join Date
    03-30-2006
    Posts
    4

    Printer.Print Not Working?

    i have a command button that i am using to try and print a few things, i have the code set up like this :

    printer.print "hello world!"

    but when i click the button i get the following error :

    "Run-Time Error- '424'
    "Object Required"

    any ideas on how to fix the problem ?

  2. #2
    Jim May
    Guest

    Re: Printer.Print Not Working?

    The VBA line is:
    ActiveSheet.PrintOut


    "pike168" <pike168.25m27m_1143937501.7283@excelforum-nospam.com> wrote in
    message news:pike168.25m27m_1143937501.7283@excelforum-nospam.com...
    >
    > i have a command button that i am using to try and print a few things,
    > i have the code set up like this :
    >
    > printer.print "hello world!"
    >
    > but when i click the button i get the following error :
    >
    > "Run-Time Error- '424'
    > "Object Required"
    >
    > any ideas on how to fix the problem ?
    >
    >
    > --
    > pike168
    > ------------------------------------------------------------------------
    > pike168's Profile:
    > http://www.excelforum.com/member.php...o&userid=32986
    > View this thread: http://www.excelforum.com/showthread...hreadid=528922
    >




  3. #3
    Registered User
    Join Date
    03-30-2006
    Posts
    4
    so would the following work :

    ActiveSheet.PrintOut "hello world"

    because it doesnt seem to be working for me

  4. #4
    Dave Peterson
    Guest

    Re: Printer.Print Not Working?

    In excel, you print a range, a worksheet, or a workbook. You don't send strings
    directly to the printer with .printout.

    You can open the printer port and print that way, though:

    Option Explicit
    Sub testme01()
    Open "LPT1:" For Output As #1
    Print #1, "Hello world!"
    Close #1
    End Sub



    pike168 wrote:
    >
    > so would the following work :
    >
    > ActiveSheet.PrintOut "hello world"
    >
    > because it doesnt seem to be working for me
    >
    > --
    > pike168
    > ------------------------------------------------------------------------
    > pike168's Profile: http://www.excelforum.com/member.php...o&userid=32986
    > View this thread: http://www.excelforum.com/showthread...hreadid=528922


    --

    Dave Peterson

  5. #5
    Jim May
    Guest

    Re: Printer.Print Not Working?

    I entered into a new Workbook - Sheet1 cell B4 "Hello world"
    I then did ALT-F11 to get into VBE;
    Pressing Control-G took me to the immediate window
    where I typed..

    Activesheet.Printout (then pressed enter)

    My print then produces a single page with
    Hello world (only)
    OK?


    "pike168" <pike168.25mwrm_1143977101.0034@excelforum-nospam.com> wrote in
    message news:pike168.25mwrm_1143977101.0034@excelforum-nospam.com...
    >
    > so would the following work :
    >
    > ActiveSheet.PrintOut "hello world"
    >
    > because it doesnt seem to be working for me
    >
    >
    > --
    > pike168
    > ------------------------------------------------------------------------
    > pike168's Profile:
    > http://www.excelforum.com/member.php...o&userid=32986
    > View this thread: http://www.excelforum.com/showthread...hreadid=528922
    >




  6. #6
    Dave Peterson
    Guest

    Re: Printer.Print Not Working?

    ps. I didn't mean to give the impression that those are the only thing that
    ..printout applies to. You can select printout in your code and hit F1, then the
    Applies to link to see all the options.

    Dave Peterson wrote:
    >
    > In excel, you print a range, a worksheet, or a workbook. You don't send strings
    > directly to the printer with .printout.
    >
    > You can open the printer port and print that way, though:
    >
    > Option Explicit
    > Sub testme01()
    > Open "LPT1:" For Output As #1
    > Print #1, "Hello world!"
    > Close #1
    > End Sub
    >
    > pike168 wrote:
    > >
    > > so would the following work :
    > >
    > > ActiveSheet.PrintOut "hello world"
    > >
    > > because it doesnt seem to be working for me
    > >
    > > --
    > > pike168
    > > ------------------------------------------------------------------------
    > > pike168's Profile: http://www.excelforum.com/member.php...o&userid=32986
    > > View this thread: http://www.excelforum.com/showthread...hreadid=528922

    >
    > --
    >
    > Dave Peterson


    --

    Dave Peterson

+ Reply to Thread

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