Speedometer Dial in Excel 2003 and multiple images

mond007

New Member
Joined
Oct 9, 2008
Messages
34
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-com:office:office" /><o:p></o:p>
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:p></o:p>
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:p></o:p>
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:p></o:p>
See www.specialistwebdesign.com/chartdial.zip (place all files in the same dir).
<o:p></o:p>
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:p></o:p>
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:p></o:p>
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:p></o:p>
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:p></o:p>
Code:
[FONT=Trebuchet MS]=EMBED("Forms.CommandButton.1","")[/FONT]
<o:p></o:p>
Thanks in advance for your thoughts. Kuldip
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Yes, this one and a few others mentioned in this area.
I have looked at all the examples but the graphics are somewhat poor.

Kind Regards Kuldip.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top