|
-
Apr 25th, 2010, 02:24 AM
#1
Thread Starter
New Member
Generating charts and graphs without Excel
Hi
I'm trying to accomplish one of the following:
a) Generate charts and graphs in Excel without using any macros
or
b) Come up with a way to generate charts and graphs without using Excel at all.
Does anybody have any idea if that's possible and if there are any alternatives to using Excel?
-
Apr 25th, 2010, 04:32 AM
#2
Re: Generating charts and graphs without Excel
Welcome to VBForums 
a) You can create a macro to do it, and then move the code from a macro into your program, see my Excel tutorial (link in my signature) for an explanation of how to do it.
b) Find/buy a component that does it (I recommend a search of our CodeBank/UtilityBank forums), or write your own.
-
Apr 25th, 2010, 08:14 AM
#3
-
Apr 25th, 2010, 08:19 AM
#4
Re: Generating charts and graphs without Excel
If you run this sample in the VB6 IDE it may fail the first time with a "collating sequence" error. Just run it again.
This is a long-standing bug in the IDE itself when using certain MDAC/DAC components. It won't happen in a compiled program.
-
Apr 25th, 2010, 09:15 AM
#5
Re: Generating charts and graphs without Excel
kaam
In addition to the ways listed above, there is always the "brute force"
method, namely, use a PictureBox and the Line method. It takes a fair
amount of work, but you will have complete control over the look-and-feel
of the chart.
Spoo
-
Apr 25th, 2010, 12:37 PM
#6
Thread Starter
New Member
Re: Generating charts and graphs without Excel
si_the_geek: my macros would look different each time. The spreadsheets I'm generating are based on 50+ collections and data from the access database that user entered previously into the program. A component that does what I need would be great. I did some research, but with no results.
dilettante: yes, I'm looking for a way to display charts and print them out too. Thank you for the sample.
spo: thank you, but the brute force method you described simply won't work. We're talking about a huge amount of coding, it's a large project.
-
Apr 25th, 2010, 12:54 PM
#7
Re: Generating charts and graphs without Excel
 Originally Posted by kaamiljj
si_the_geek: my macros would look different each time. The spreadsheets I'm generating are based on 50+ collections and data from the access database that user entered previously into the program.
Without knowing how your current code works (and what you want to graph) I can't be sure, but there is a very good chance that you can use just one 'macro' with minor modifications.
However, depending on the circumstances using a separate component (like the one dilettante suggested) rather than Excel may be a better idea.
-
Apr 25th, 2010, 12:59 PM
#8
Re: Generating charts and graphs without Excel
If the users would all have Office installed... it includes a fancier chart component you can use from a VB6 program too. It can't be redistributed though.
Most charting controls have fairly complicated object models to learn.
-
Apr 25th, 2010, 07:36 PM
#9
Re: Generating charts and graphs without Excel
I made this bar chart using the shape control and some labels. It just takes a little arithmetic to set the height of the bars based on the data.

As you can see, I flunked all the comprehensive exams using random responses to the questions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|