Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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 ?


--
pike168
------------------------------------------------------------------------
pike168's Profile: http://www.excelforum.com/member.php...o&userid=32986
View this thread: http://www.excelforum.com/showthread...hreadid=528922

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Printer.Print Not Working?

The VBA line is:
ActiveSheet.PrintOut


"pike168" wrote in
message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printer.Print Not Working?


so would the following work :

ActiveSheet.PrintOut "hello world"

because it doesnt seem to be working for m

--
pike16
-----------------------------------------------------------------------
pike168's Profile: http://www.excelforum.com/member.php...fo&userid=3298
View this thread: http://www.excelforum.com/showthread.php?threadid=52892

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default 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" wrote in
message ...

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print to Excel instead of Printer? Jeremy Excel Discussion (Misc queries) 2 April 22nd 23 02:07 AM
how can I use print preview without having a printer cookie Excel Discussion (Misc queries) 5 December 2nd 08 02:40 PM
Unable to Print to Printer Bob Excel Discussion (Misc queries) 3 December 5th 07 09:37 PM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
how can I get my printer to print in grayscale ? FRUSTRATED Excel Discussion (Misc queries) 1 November 23rd 05 03:21 AM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"