• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

To print a Excel's worksheet with VB

How can I  print a Excel's worksheet with VB instructions?
If it's posible I don't want to open the Excel to do it.
Thanks
0
abautistat
Asked:
abautistat
1 Solution
 
mark2150Commented:
VB is not going to understand the in's & out's of an Excel spreadsheet. Easist way is to go ahead and fire up Excel and then use SendKeys to tell it what file to open and print. This is *MUCH* less work than trying to decipher the internals of an .XLS file.

Even if you simply "drag & drop" an .XLS file to the printer, the *OS* will open Excel to print it!

M

0
 
cognitionCommented:
Another solution would be to create an excel object within VB, and use the methods to open the workbook, and print method to print it. You don't have to make the Excel object visible.

Using an excel object will also allow you to handle any errors that occur, and to select ranges, or set the print range.
0
 
trillian30Commented:
I agree with cognition.
I have an app that uses an Excel object to create an excel worksheet, print out the worksheet and save the whole thing without the user ever seeing Excel.
It works very nicely.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mark2150Commented:
Ok, reject me and give the points to Cognition.

M
0
 
BETTYCommented:
If I were abautistat and I had enough points, I would give BOTH the points: to cognition 'cause it's the best answer, but to mark2150 too because it's not frequent to see someone that works for free helping other people, and furthermore is capable of give the only reward (the points) to a third person.

This is the way all experts and contributors in Experts-Exchange ought to be.

¿No crees que es así, abautistat?
0
 
mark2150Commented:
Thanks! (Small smile and tip o' the hat!)

M

0
 
abautistatAuthor Commented:
I agree with Betty, but I have to give the points to mark2150. I hope that mark gives some points to cognition...
Thank you.

Creo que es lo justo, ¿qué te parece Betty?
0
 
mark2150Commented:
Fair enough! I'll split em out!
M

0
 
mark2150Commented:
Did you see that happened to the points I posted for cognition! Some people don't understand!

http://www.experts-exchange.com/Q.10116558

M

0
 
BETTYCommented:
Unfortunately, really some people don't understand.

But we have to keep fighting for supporting this great system of interchange and collaboration. We can't prevent from these "viruses" acting this way!

And, as I suspected, abautistat is Spanish as I. It's fantastic look outside and see our people working with English-speaking ones! We're starting, but let's look at the future.

Saludos desde Barcelona, EEC!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now