Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item(1)
I create a sample BlockArc using:
Sub MakeMyArc() Sheet1.Range("F6").Worksheet.Shapes.AddShape msoShapeBlockArc, 200, 200, 100, 100 End Sub Now I want to use the adjustments item(1) to make it the desired size Sub ResizeIt ActiveSheet.Shapes("AutoShape 1").Select Selection.ShapeRange.Adjustments.Item(1) = 2 End Sub I've tried different values for Item(1), and get all sorts of weird behavior. Sometimes the whole shape "flips" to the other side of the (imaginary) circle, and in my testing I can't tell if I should be using values between 0-1, 0-100, 0-360, etc. I also (because I can't figure out the pattern in the shape changes) don't know if the Adjustments.Item(1) is a final value assigned, or if it is a percentage that is calculated against the existing value, etc. If anyone has worked with msoShapeBlockArc and could explain to me how to use Item(1) to create a wedge of a desired size, I'd really appreciate it. For example: Initial wedge is created as a half-circle (top half). I'll worry about rotation later, but for now I want to change it so that it changes with each loop, for example: Loop1: wedge is 90 degrees of the circle (25%) Loop2: wedge is 36 degrees of the circle (10%) Loop3: wedge is 270 degrees of the circle (75%) then finally, back to the original size of 180 degrees (50%) Any information about how Adjustments.Item(1) works would be greatly appreciated!! Thank you, Keith |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item(1)
Hi,
This is for xl2007 but you should find it helpful. http://www.andypope.info/tips/tip013.htm On the sheet, Adjust3, you will need to alter the values in J7 and J8 as currently they are too small for the Arc shape. Remove the division by 100. You should then see the values for Item(1) and Item(2) are in the 0 to 360 range. Defining start and finish angles in relation to zero at the 3 o'clock position going clockwise. Arc on top would be Item(1)=180 Item(2)=0 Arc on bottom would be Item(1) =360 Item(2)=180 Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "ker_01" wrote in message ... I create a sample BlockArc using: Sub MakeMyArc() Sheet1.Range("F6").Worksheet.Shapes.AddShape msoShapeBlockArc, 200, 200, 100, 100 End Sub Now I want to use the adjustments item(1) to make it the desired size Sub ResizeIt ActiveSheet.Shapes("AutoShape 1").Select Selection.ShapeRange.Adjustments.Item(1) = 2 End Sub I've tried different values for Item(1), and get all sorts of weird behavior. Sometimes the whole shape "flips" to the other side of the (imaginary) circle, and in my testing I can't tell if I should be using values between 0-1, 0-100, 0-360, etc. I also (because I can't figure out the pattern in the shape changes) don't know if the Adjustments.Item(1) is a final value assigned, or if it is a percentage that is calculated against the existing value, etc. If anyone has worked with msoShapeBlockArc and could explain to me how to use Item(1) to create a wedge of a desired size, I'd really appreciate it. For example: Initial wedge is created as a half-circle (top half). I'll worry about rotation later, but for now I want to change it so that it changes with each loop, for example: Loop1: wedge is 90 degrees of the circle (25%) Loop2: wedge is 36 degrees of the circle (10%) Loop3: wedge is 270 degrees of the circle (75%) then finally, back to the original size of 180 degrees (50%) Any information about how Adjustments.Item(1) works would be greatly appreciated!! Thank you, Keith |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item
Brilliant!
Thanks Andy!! Keith "Andy Pope" wrote: Hi, This is for xl2007 but you should find it helpful. http://www.andypope.info/tips/tip013.htm On the sheet, Adjust3, you will need to alter the values in J7 and J8 as currently they are too small for the Arc shape. Remove the division by 100. You should then see the values for Item(1) and Item(2) are in the 0 to 360 range. Defining start and finish angles in relation to zero at the 3 o'clock position going clockwise. Arc on top would be Item(1)=180 Item(2)=0 Arc on bottom would be Item(1) =360 Item(2)=180 Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "ker_01" wrote in message ... I create a sample BlockArc using: Sub MakeMyArc() Sheet1.Range("F6").Worksheet.Shapes.AddShape msoShapeBlockArc, 200, 200, 100, 100 End Sub Now I want to use the adjustments item(1) to make it the desired size Sub ResizeIt ActiveSheet.Shapes("AutoShape 1").Select Selection.ShapeRange.Adjustments.Item(1) = 2 End Sub I've tried different values for Item(1), and get all sorts of weird behavior. Sometimes the whole shape "flips" to the other side of the (imaginary) circle, and in my testing I can't tell if I should be using values between 0-1, 0-100, 0-360, etc. I also (because I can't figure out the pattern in the shape changes) don't know if the Adjustments.Item(1) is a final value assigned, or if it is a percentage that is calculated against the existing value, etc. If anyone has worked with msoShapeBlockArc and could explain to me how to use Item(1) to create a wedge of a desired size, I'd really appreciate it. For example: Initial wedge is created as a half-circle (top half). I'll worry about rotation later, but for now I want to change it so that it changes with each loop, for example: Loop1: wedge is 90 degrees of the circle (25%) Loop2: wedge is 36 degrees of the circle (10%) Loop3: wedge is 270 degrees of the circle (75%) then finally, back to the original size of 180 degrees (50%) Any information about how Adjustments.Item(1) works would be greatly appreciated!! Thank you, Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ShapeRange.Name | Excel Programming | |||
Got error in Shapes.AddShape() | Charts and Charting in Excel | |||
Strange Shapes.AddShape error | Excel Programming | |||
.AddShape(Type, Left, Top, Width, Height) | Excel Programming | |||
Selection.ShapeRange.IncrementLeft error | Excel Programming |