Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Chart From VB

Status
Not open for further replies.

Phathi

Programmer
Aug 10, 2001
60
ZA
Hi,

How do I draw a chart in an excel document that I created from VB.

I populate the sheet with values from a database for the past X weeks and need to show graphical representation as well.

anybody?!
 
A way to do this is to set up the excel sheet with the chart already in it.

In your app, export the data [query | Table] to a nammed range in the workbook.

Switch to Excel, open the work book, generate the chart from the named range. I ALWAYS place the chart on a seperate sheet, so there is NO possibility of overwritting the chart with the data.

The next time you export the data to the workbook and open the sheet with the chart on it, it will reflect the new data.



MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
If you really want power and flexibility use the Microsoft Office Web Component 9.0 ActiveX controls that comes with Office 2000. You can place an Excel grid in your app. and modify at will ... I use it for my apps. and it works great! If you don't know how to do something, load Excel 2000, record a macro, and review the code to see how Excel handles functions.
 
If all your coding is working, then I would suggest a great tool. Look for a software called oFramer. It fully loads Excel or Word in VB. And you can customize all the coding also.

Try it, it's worth it.

Have fun...
 
Dzidze,

I asked a simular excel question and you also said to use oFramer, but it's 10 million api calls. Could you be more specific on how to modify this code? I spent 1/2 day trying to modify this program, so possibly I'm missing something simple here?

Thank you.
 
Hi F1car.

Maybe I have not been specific enough about it. The reason I recommend it is because you do not need to change what is already inside (since all the fonctionnalities are there).
(Although I also played around the original coding to add some new features at start-up)
It has saved me a lot of time by starting new projects with this tool (users think it's great...). All you have to do is add your own coding, controls, etc... so your new app does what you want.

Hope that answers some questions.
 
I have used this little free software for some time now. I did custumized it to my own preferences, but it is very usefull. I also would recommend it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top