Hi, I have seen various discussions about creating a speedometer style dial using 2007 etc but no conclusive way of doing it in 2003. (Maybe there isn’t). Anyway I set out to have a go myself.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Ok, I started by creating 41 images files (1 file for every 2.5% interval) and thought of displaying what ever file is relevant for the Percentage that needs to be displayed. The idea was that if I set a certain cell value to say 50% the I was going to display the image file corresponding to a dial that showed the pointer at 50%. i.e. Chart_Dial_01_050_0.bmp etc. Likewise for the all the other files starting from 0% to 100% (i.e. Chart_Dial_01_000_0.bmp, Chart_Dial_01_002_5.bmp, Chart_Dial_01_005_0.bmp all the way upto Chart_Dial_01_100_0.bmp etc.
<o></o>
I decided to use a button & I used the following code :
<o></o>
Currently I just used a few buttons to display different Percentages and works but the final solution would use a value in a certain cell.
<o></o>
See www.specialistwebdesign.com/chartdial.zip (place all files in the same dir).
<o></o>
THE PROBLEM : Anyway, I hit a snag in that this works BUT the drawback is that I have to have the commandbutton named and images in a certain dir meaning that if I was to send it to someone they would need to save the chart images to current directory. So, I want to make it portable and self contained in the source file. Also, I should be able to copy/create more speedometer dials easily as I might want several dials on one Worksheet.
<o></o>
Things I have tried. I have tried to copy a image to a new workbook and this maintains the image name on any worksheet. i.e. If I insert an image on to my current workbook and call it Picture000_0 (in the name drange box) and then subsequently copy it to another workbook then the file is still called the same. However if I copy a command button it does not maintain the command button name, it just allocated the next number i.e. commandbutton10.
<o></o>
The other thought I had was to create 41 buttons with pointer every 2.5% intervals and code to either make .visible or .invisible all other except that one I want to display. I am currently working on this but would welcome comments.
<o></o>
QUESTION : Does anyone know of a way I can load a picture that is within the current workbook and not external to the workbook. I really wanted to have a set of standard 41 images and just load then one I want depending upon the required percentage. BUT I can not find a way to referencing an image internal to the workbook. i.e. see the following code:
<o></o>
<o></o>
Thanks in advance for your thoughts. Kuldip
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Ok, I started by creating 41 images files (1 file for every 2.5% interval) and thought of displaying what ever file is relevant for the Percentage that needs to be displayed. The idea was that if I set a certain cell value to say 50% the I was going to display the image file corresponding to a dial that showed the pointer at 50%. i.e. Chart_Dial_01_050_0.bmp etc. Likewise for the all the other files starting from 0% to 100% (i.e. Chart_Dial_01_000_0.bmp, Chart_Dial_01_002_5.bmp, Chart_Dial_01_005_0.bmp all the way upto Chart_Dial_01_100_0.bmp etc.
<o></o>
I decided to use a button & I used the following code :
Code:
[SIZE=3][FONT=Trebuchet MS] img_file = ActiveWorkbook.Path & "/" & "Chart_Dial_01_000_0.bmp"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Trebuchet MS] ActiveSheet.cmdb_chart_01.Picture = LoadPicture(img_file)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Trebuchet MS] ActiveSheet.cmdb_chart_01.Caption = "Chart_Dial_01_000_0.bmp"[/FONT][/SIZE]
<o></o>
Currently I just used a few buttons to display different Percentages and works but the final solution would use a value in a certain cell.
<o></o>
See www.specialistwebdesign.com/chartdial.zip (place all files in the same dir).
<o></o>
THE PROBLEM : Anyway, I hit a snag in that this works BUT the drawback is that I have to have the commandbutton named and images in a certain dir meaning that if I was to send it to someone they would need to save the chart images to current directory. So, I want to make it portable and self contained in the source file. Also, I should be able to copy/create more speedometer dials easily as I might want several dials on one Worksheet.
<o></o>
Things I have tried. I have tried to copy a image to a new workbook and this maintains the image name on any worksheet. i.e. If I insert an image on to my current workbook and call it Picture000_0 (in the name drange box) and then subsequently copy it to another workbook then the file is still called the same. However if I copy a command button it does not maintain the command button name, it just allocated the next number i.e. commandbutton10.
<o></o>
The other thought I had was to create 41 buttons with pointer every 2.5% intervals and code to either make .visible or .invisible all other except that one I want to display. I am currently working on this but would welcome comments.
<o></o>
QUESTION : Does anyone know of a way I can load a picture that is within the current workbook and not external to the workbook. I really wanted to have a set of standard 41 images and just load then one I want depending upon the required percentage. BUT I can not find a way to referencing an image internal to the workbook. i.e. see the following code:
<o></o>
Code:
[FONT=Trebuchet MS]=EMBED("Forms.CommandButton.1","")[/FONT]
Thanks in advance for your thoughts. Kuldip