Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
printing via vba
right thanks. I've decided to use Franks approach and create a userfor where the user selects which printer they want and then the correc sheets in the spreadsheet are printed to that printer, so i have trie to use this code If UserForm1.OptionButton1.Value = True Then Application.ActivePrinte = "\\TLPRWFC020001\tlnpwfc020001" however i get an error when it runs saying "Method 'Activeprinter' o object '_Application' failed". any ideas whats wrong with my line of code? thank -- neowo ----------------------------------------------------------------------- neowok's Profile: http://www.excelforum.com/member.php...nfo&userid=594 View this thread: http://www.excelforum.com/showthread.php?threadid=27202 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
printing via vba
select the printer manually.
now type in the immediate pane.. ?application.activeprinter you'll need to use the full string returned in the imm.pane INCLuding the 16bit port Id. (Net01: or similar) keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool neowok wrote: right thanks. I've decided to use Franks approach and create a userform where the user selects which printer they want and then the correct sheets in the spreadsheet are printed to that printer, so i have tried to use this code If UserForm1.OptionButton1.Value = True Then Application.ActivePrinter = "\\TLPRWFC020001\tlnpwfc020001" however i get an error when it runs saying "Method 'Activeprinter' of object '_Application' failed". any ideas whats wrong with my line of code? thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
printing via vba
Neowok -
Alternately, you can invoke the Excel dialog and let your user select from the known printers strOldActivePrinter = Application.ActivePrinter Application.Dialogs(9).show If you want to capture the name by which Excel knows the selected printer - you could also set a text box's text to the new value strNewActivePrinter = Application.ActivePrinter After you print the selected sheets, be sure to return the ActivePrinter to its original setting with Application.ActivePrinter = strOldActivePrinter Otherwise, your users will curse your name : ) James Cox "neowok" wrote in message ... right thanks. I've decided to use Franks approach and create a userform where the user selects which printer they want and then the correct sheets in the spreadsheet are printed to that printer, so i have tried to use this code If UserForm1.OptionButton1.Value = True Then Application.ActivePrinter = "\\TLPRWFC020001\tlnpwfc020001" however i get an error when it runs saying "Method 'Activeprinter' of object '_Application' failed". any ideas whats wrong with my line of code? thanks -- neowok ------------------------------------------------------------------------ neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940 View this thread: http://www.excelforum.com/showthread...hreadid=272024 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 printing problem--printing 1 document on 2 pages | Excel Discussion (Misc queries) | |||
Excel Printing --Borders are not printing on the same page as data | Excel Discussion (Misc queries) | |||
Printing a heading on each new page when printing | Excel Discussion (Misc queries) | |||
Enable Double sided printing contiuously when printing multiple s. | Excel Discussion (Misc queries) | |||
Printing? Worksheets not printing the same on multiple pc's! | Excel Programming |