Question:

How do I add data to excel chart using VB6?

by  |  earlier

0 LIKES UnLike

I have made some simple standalone VB6 programs but not with excel. I have made a chart in excel and I want to make a VB6 program that can add data to rows and columns in the chart and save it. There will be command buttons that will make choices what data will be added one row / column at a time and a save button for each step. Can this be done simply?

 Tags:

   Report

1 ANSWERS


  1. Yes, it can be done simply.  But you want to do it in Excel, not VB6.  Excel's VBA includes most of the capabilities of VB6 including forms.  If you haven’t been there before, press Alt-F11 to view the VBAProject .  Note the Microsoft Excel Objects and the large panel with the two drop down list at the top.  Select (General) > Worksheet and then look at the other dropdown list.

    Also select Insert > UserForm to see the VBA near equivalent to a VB6 form.  As you look around you will see more familiar things.

    Back in a worksheet, select Tools > Macro > Record New Macro > OK.  Then do a few things in the worksheet like formatting cells, adding rows, naming ranges, or whatever.  Then select Tools > Macro > Stop Recording > Alt-F11 and notice the new Modules folder.  Expand it, double click Module1, and select Macro1 in the (Declarations) dropdown list to see the VBA code to do what you just recorded.

    That should be enough to get you started with the fun of discovering Excel VBA Macros.  I hope you are using Excel 2003, it is a bit simpler, than 2007, to get around in and the Visual Basic help is local rather than on line.  The part I use most is Help > Microsoft Visual Basic Help > Microsoft Visual Basic Documentation > Visual Basic Language Reference.  The other aid I use constantly is the View > Object Browser.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.