Solved

To print a Excel's  worksheet with VB

Posted on 1999-01-11
10
277 Views
Last Modified: 2010-05-03
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
Comment
Question by:abautistat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 200 total points
ID: 1455430
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
 
LVL 3

Expert Comment

by:cognition
ID: 1455431
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
 

Expert Comment

by:trillian30
ID: 1455432
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mark2150
ID: 1455433
Ok, reject me and give the points to Cognition.

M
0
 
LVL 1

Expert Comment

by:BETTY
ID: 1455434
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
 
LVL 12

Expert Comment

by:mark2150
ID: 1455435
Thanks! (Small smile and tip o' the hat!)

M

0
 

Author Comment

by:abautistat
ID: 1455436
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
 
LVL 12

Expert Comment

by:mark2150
ID: 1455437
Fair enough! I'll split em out!
M

0
 
LVL 12

Expert Comment

by:mark2150
ID: 1455438
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
 
LVL 1

Expert Comment

by:BETTY
ID: 1455439
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question