Error 1004 Activeprinter
Contents |
Forums Excel Questions Runtime Error '1004': Results 1 to 9 of 9 Runtime Error '1004':This is a discussion on Runtime Error '1004': within the Excel Questions forums, part of the Question
Application.activeprinter Vba
Forums category; How do I fix the following problem? The code runs fine method activeprinter of object application failed on my computer but when switching to another computer ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg
Vba Set Active Printer
this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Mar 21st, 2007,09:35 AM #1 outback New Member vba activeprinter Join Date Aug 2006 Location Missouri Posts 19 Runtime Error '1004': How do I fix the following problem? The code runs fine on my computer but when switching to another computer on the same network, mapped to the same printer it won't run through the macro without this error on their computer. However, you can go to file, print, and select this printer and it prints out without any problem to the printer specified in the code. Runtime Error '1004': Method 'ActivePrinter' of object '_Application' failed Code: Application.ActivePrinter = "hp color LaserJet 4600 on Ne05:" ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _ "hp color LaserJet 4600 on Ne05:", Collate:=True Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Mar 21st, 2007,10:52 AM #2 tom_crisp Board Regular Join Date Jul 2006 Posts 133 Check to see if the printer is named the same way and works on the same port in control panel > printer. The fact that the problem occurs on different computers makes this a likely issue. Don't know if there is VBA to get the default printer on a certain machine though. EDIT: seems you can use 'application.activeprinter' to get the name of the default printer. Try that. EDIT2: See here for usable code http://www.erlandsendata.no/english/...tchangeprinter Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Mar 21st, 2007,11:18 AM #3 Richard Schollar MrExcel MVPModeratorInactive Join Date Apr 2005 Location UK Posts 23,696 Application.ActivePrinter = "hp color LaserJet 4600 on Ne05:" I would presume that hp color LaserJet 4600 isn't on Ne05 in this other person's computer. You can check what all th
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips http://www.mrexcel.com/forum/excel-questions/253417-runtime-error-1004-a.html Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. VBA Visual Basic for Applications (Microsoft) Forum at Tek-Tips HomeForumsProgrammersLanguagesVBA Visual Basic http://www.tek-tips.com/viewthread.cfm?qid=879030 for Applications (Microsoft) Forum Application.ActivePrinter port name in Excel ??? thread707-879030 Forum Search FAQs Links MVPs Application.ActivePrinter port name in Excel ??? Application.ActivePrinter port name in Excel ??? SteveFairclough (IS/IT--Management) (OP) 13 Jul 04 07:43 HiI am trying to get my code to select a PDF printer to generate PDF files. When I look at the properties of the printer in XP, the details arePrinter Name "Win2PDF"Printer Port "PDFFILE:"Therefore, my code for selecting the printer isApplication.ActivePrinter = "Win2PDF on PDFFILE:"However, if I run this code, the following error is displayedRun Time error '1004'Method 'ActivePrinter' of object '_Application' failed So, I then recordred a macro to select the printer and it came up with the following codeApplication.ActivePrinter = "Win2PDF on NE04:"So, now I'm confused. I need to run this Excel VBA project on three different computers and each one shows a different "NE" port name for the Win2PDF printer.Finally, my question, How do I either detect which NE port name
Forum Microsoft Office Application Help - Excel Help forum Excel Programming / VBA / Macros Simple VBA to set Active Printer up To get replies by our experts at nominal charges, follow this link to buy points and post your thread in our Commercial Services forum! Here http://www.excelforum.com/showthread.php?t=603163 is the FAQ for this forum. + Reply to Thread Results 1 to 3 of 3 Simple VBA to set Active Printer up Thread Tools Show Printable Version Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 06-11-2007,04:51 PM #1 mikeburg View Profile View Forum Posts Forum Contributor Join Date 06-23-2005 Posts 253 Simple VBA to set Active Printer error 1004 up When I use the following I get an error message when I have the following VBA under ThisWorkbook: Please Login or Register to view this content. The error message I get is: Run-time error '1004': Method 'ActivePrinter' of object '_Application' failed What is the simplest VBA I change the active printer to a printer named "HP LaserJet 4005 PCL 6 on HPL6"? Thanks a million. mikeburg Last edited by VBA Noob; 06-11-2007 at 07:28 PM. Register error 1004 activeprinter To Reply 06-11-2007,06:56 PM #2 bhofsetz View Profile View Forum Posts Forum Contributor Join Date 01-21-2005 Location Colorado MS-Off Ver 2000,2003,2007 Posts 481 Check to make sure you have the complete name of the printer. Put a breakpoint at your Application.ActivePrinter = "HP LaserJet 4005 PCL 6 on HPL6" line and then add Application.ActivePrinter to your watch list and see if the printer's name is indeed "HP LaserJet 4005 PCL 6 on HPL6". Otherwise your code should set the active printer to the one specified. HTH Register To Reply 06-12-2007,09:06 AM #3 mikeburg View Profile View Forum Posts Forum Contributor Join Date 06-23-2005 Posts 253 You are correct. I had the printer slightly wrong. I can't believe I did that! Thanks for your help. mikeburg Register To Reply + Reply to Thread « Previous Thread | Next Thread » Thread Information Users Browsing this Thread There are currently 1 users browsing this thread. (0 members and 1 guests) Bookmarks Bookmarks Digg del.icio.us StumbleUpon Google Posting Permissions You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules -- vB4 Default Style -- Mobile Style Premium -- Lightweight Contact Us ExcelTip.com Archive Top All times are GMT -4. The time now is 02:08 AM. Powered by vBulletin® Version 4.1.8 Copyright ©