Very thanks

I tested this code on computer which has printer installed but this printer's 
power is off

Is " ActivePrinter" means installed but not plug in ?

That is exactly what I want

 

 

 

From: excel-macros@googlegroups.com [mailto:excel-mac...@googlegroups.com] On 
Behalf Of ashish koul
Sent: Friday, November 05, 2010 11:01 AM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ FW: is there a printer installed on this computer?

 

try this code it will help you in checking whether printer is installed or not 
and accordingly you can  make changes in ur code 

Sub a()

On Error Resume Next
Application.ActivePrinter = x


If x = "" Then

MsgBox "Printer Not Installed"

Else

MsgBox x

End If

End Sub





On Fri, Nov 5, 2010 at 1:18 PM, عمــــــــــــر <omar27...@gmail.com> wrote:

 

 

From: عمــــــــــــر [mailto:omar27...@gmail.com] 
Sent: Monday, November 01, 2010 7:31 PM
To: MS EXCEL AND VBA MACROS
Subject: is there a printer installed on this computer?

 

I have a code to copy some data from sheet to another

 

In the end of this code

There is some lines to set up page layout

"page setup"

Header and footer

 

This part of code doesn't work when I run my file on computer without printer 
installed

And give me an error

 

The question is

How can I make this code works well when the printer is installed or when not 
installed ?

Thanks 

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
 
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall 
<http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts> 
&ref=ts




-- 

Regards

 

Ashish Koul

 <http://akoul.blogspot.com/> akoul.blogspot.com

 <http://akoul.wordpress.com/> akoul.wordpress.com

My <http://in.linkedin.com/pub/ashish-koul/10/400/830>  Linkedin Profile

 

P Before printing, think about the environment.

 

 

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
 
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall 
<http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts> 
&ref=ts

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts

Reply via email to