How Can I have an actice bar diagram on a User Form in VBA in Excel and how to define the macros for that?
How Can I have an actice bar diagram on a User Form in VBA in Excel and how to define the macros for that?
Two ways:
Export chart as image file, load picture into image control on form
http://www.j-walk.com/ss/excel/tips/tip66.htm
Copy chart, use APIs to load clipboard contents into image control
http://oaltd.co.uk/DLCount/DLCount.a...stePicture.zip
You could also investigate the Office Web Charting Component, but I have never used it.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com
_______
I cannot download the demo file in the first link. in the second Zip file there is a lot of programming under module and form. Is there any easier way to make an active Bar diagram?
If there were a simpler way, do you think such smart programmers as John Walkenbach and Stephen Bullen would have wasted time developing these techniques?
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com
_______
I'm not into charting, but I have a basic example of a userform chart using OWC (Office Web Components) here that I did up for demo purposes that may get you started...
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Dear JohnSke,
This is fine. but how can I put North,south,Esat,west the horizentol axis and 1997 and 1998 the vertical bar diagrams?
Thanks & Regaeds,
Maryam
Where it says .Type = chChartTypeBarClustered, change that to .Type = chChartTypeColumnClustered
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
FYI, here's a list of all the chart-types available for OWC charts...
chChartTypeArea
chChartTypeAreaStacked
chChartTypeAreaStacked100
chChartTypeBarClustered
chChartTypeBarStacked
chChartTypeBarStacked100
chChartTypeBubble
chChartTypeBubbleLine
chChartTypeColumnClustered
chChartTypeColumnStacked
chChartTypeColumnStacked100
chChartTypeCombo
chChartTypeDoughnut
chChartTypeDoughnutExploded
chChartTypeLine
chChartTypeLineMarkers
chChartTypeLineStacked
chChartTypeLineStacked100
chChartTypeLineStacked100Markers
chChartTypeLineStackedMarkers
chChartTypePie
chChartTypePieExploded
chChartTypePieStacked
chChartTypePolarLine
chChartTypePolarLineMarkers
chChartTypePolarMarkers
chChartTypePolarSmoothLine
chChartTypePolarSmoothLineMarkers
chChartTypeRadarLine
chChartTypeRadarLineFilled
chChartTypeRadarLineMarkers
chChartTypeRadarSmoothLine
chChartTypeRadarSmoothLineMarkers
chChartTypeScatterLine
chChartTypeScatterLineFilled
chChartTypeScatterLineMarkers
chChartTypeScatterMarkers
chChartTypeScatterSmoothLine
chChartTypeScatterSmoothLineMarkers
chChartTypeSmoothLine
chChartTypeSmoothLineMarkers
chChartTypeSmoothLineStacked
chChartTypeSmoothLineStacked100
chChartTypeSmoothLineStacked100Markers
chChartTypeSmoothLineStackedMarkers
chChartTypeStockHLC
chChartTypeStockOHLC
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Thank you Johnski.
Dear Johnske,
Where is VBA icon?
Sorry, what do you mean?Originally Posted by maryam
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Made your code more readable, use VBA tags
Oh OK It's on the top just to the right of centre in the pane where you post your reply...
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
So is the Office Web Component any simpler than using John's or Stephen's examples?
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com
_______
Dear JohnPeltier,
I could just open Stephen's file and couldnt open demo file of John's.Thank you for replying my thread, but there were a lot of coding behind the module and form in Stephen's file which I couldnt understand. Office web component is just adding two controls to the form and 10 lines of programming. Sorry my VBA is very bad, but the problem is that I badly need it as I should develope a software related to chemical engineering as soon as possible. So I need your helps.
Best Regards,
Mariam
The problem with OWC is if you send the file to another user, they may not have OWC installed. OWC is not installed by default, nor is it an option in all editions of Office.
Stephen's code is complicated, but you don't need to manipulate it much.
Why could you not download John's example? Do the IT nazis at work prohibit downloads of exe files? His example is really pretty simple.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com
_______
Jon has a point there Maryam, OWC was only introduced in office 2000, so anyone using office 97 may have difficulties if they haven't installed OWC (it can be installed separately on '97).
Now I have office 2000 and my own examples that were created in office 2000 have been downloaded from here and from my own site over 80 times with not one post to say that it doesn't work.
However, I've noted that with others OWC files posted here that were created in office 2002 or 2003 - I can't get the OWC component to show simply because it was created in a later version.
In other words, the only real problem I see would be if someone were trying to view it in an earlier version than yours - but if you're using the earliest version (office 2000) the only problem then would be '97 users.
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
dear Johnske I am using exel 2003.
Dear JonPeltier, I cannot open John's example still. When I want to open the demonstration it goes to extraction and finally doesn't come!
Save the exe file to disk, then double click on it. I have had no problem in the three or four times I've tested this during the life of this thread.
I would say in terms of ease and reliability, John's is best, Stephen's nearly so, and OWC somewhat further down the list.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com
_______
Thank you JohnPeltier,
I have another post about DATAGRID Control, Malik and Tommy replied to that thread, but now some there are some days that there is no other thread. DO you know about this also. Can you look at that post also please.