Link to home
Start Free TrialLog in
Avatar of ljhodgett
ljhodgett

asked on

produce an excel spreadsheet in vb

Hi Experts.

Im creating a stock control system and want to be able to produce an excel spread sheet. The stock control system will be converted into a cab file for when customers want to install it. I want to be able to create an excel spreadsheet as a formatted invoice. My question really is how to produce an excel spreadsheet and print it off without the user having excel on there PC.

Many Thanks
Lee
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Hi ljhodgett,
----------

>>> produce an excel spreadsheet and print it off without the user having excel

a bit of a tall order without resorting to writing your own conversion or buying a third party tool
there is an alternative dll that enables you to create xl files without xl from ASP

http://www.tutorialized.com/tutorial/Dynamic-Excel-Reports-with-ASP/9360

but classic asp is easily converted to vb

----------
bruintje
share what you know, learn what you don't
Avatar of yotamsher
yotamsher

if you don't need excel but rather need nice formatted printing, consider using crystal reports

Yotam
ASKER CERTIFIED SOLUTION
Avatar of kwebster7327
kwebster7327

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
though its nice code you would need excel installed on the client for this to work
Yes, you would. There are only two ways I can think of around this: buy an object that'll do it for you (be careful- some of them actually require Excel to work), or write the file in CSV format (or something else Excel reads) and have the user import it.

Directly writing an Excel formatted file is not something that's documented (at least in my experience). In any case, it'd be far more complex to do than the alternatives.

Try Google: http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLG,GGLG:2005-27,GGLG:en&q=XLS+activex
you could combine the code [from kwebster7327] with the component above [DypsXLS.XLSApplication] to create the excel sheet without excel at least if its working as advertised
If you write the file in .csv you can use the free Excel viewer to print it.  You won't get pretty formatting though.  http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&displaylang=EN

>>My question really is how to produce an excel spreadsheet and print it off without the user having excel on there PC.

I think, perhaps, your question is "How do I design a pretty invoice in Excel, and then enable my application to print it with appropriate data", which is different.  In which case what I have often done is after you are done editing you Invoice template in Excel, save it as HTML and find the text to replace.  Put the HTML in your app.
Which is a different kettle of fish entirely...