Results 1 to 9 of 9

Thread: Generating charts and graphs without Excel

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    2

    Thumbs down 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?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Generating charts and graphs without Excel

    You're posting in VB6 and Earlier, so I'm not sure why you're asking about Excel here...

    What are you actually after? A way to chart data and view it, some way to print charts?


    The MSChart control (MSCHRT20.OCX) plots several basic kinds of charts and meets a lot of needs for things below publication grade images.
    Attached Images Attached Images   
    Attached Files Attached Files

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  5. #5
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    2

    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.

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Generating charts and graphs without Excel

    Quote Originally Posted by kaamiljj View Post
    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.

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  9. #9
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    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.
    Doctor Ed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width