Another solution would be to add a macro to automatically call the print function of excel right after loading the excel file. But it will cause a lot of security warnings to user.
-----Original Message----- From: Anthony Andrews [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 6:53 PM To: POI Users List Subject: Re: How to print excel files automatically That does sound familiar! There is one thing I should warn you about however, Microsoft warn against controlling an application such as Excel - and you will need to drive an instance of Excel I think - using COM/OLE from within another application. There are a number of reasons given but the main one seems to be that Excel is designed to be used interactively and becuase there is no easy way to trap and handle the error message it issues then the user could quite quickly run into problems. Having said that, I did it after writing my own OLE code. kruce lee <[EMAIL PROTECTED]> wrote: Hi, Anthony Andrews, Thank you in advance. The tool you recommend should be Jacob and I will also dig Mucrosoft's COM API for more info. On 9/12/06, Anthony Andrews wrote: > As far as I am aware (and bear in mind that I could very well be wrong) HSSF is an API that allows you to generate Excel spreadsheets and does not have any support for printing. I managed to get around exactly the same problem by using OLE but this is a far from perfect solution as it caused almost as many problems as it solved; it is however one possible solution. > > I know there is a tool that someone wrote that is a wrapper around JNI, making it far more easy to use external applications in a way that mimics Microsoft's COM model. I cannot remember the name at the moment but will have a dig around on my PC as I seem to remember testing it sometime in the past. > > kruce lee wrote: Hi everybody > How to print a excel file automatically when I get the file path or resource. > Can someone give me a snippet. > Any help would be highly appreciated > kruce. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > Mailing List: http://jakarta.apache.org/site/mail2.html#poi > The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ > > > > > --------------------------------- > Get your email and more, right on the new Yahoo.com > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------- Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail. -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.3/445 - Release Date: 9/11/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.3/445 - Release Date: 9/11/2006 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
