VBA Formatting of A 3D Shape

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am trying to create a 3d shape with VBA on my worksheet. I am having difficulty assigning the 3d properties. (I took a sample from a Google Search but I don't think I'm pursuing the right parameters). The line in red ius throwing the error "The specified value is out of range". I assume msoRelaxedBVevel is inappropriate?

I have a rounded rectangle base shape. From the 3d properties, my 3d shape takes on these characteristics:
Top Bevel Type = Relaxed Bevel (second row, second in from left in the menu)
Top Bevel Width = 6.5 pt
Top Bevel Height = 5 pt

Here is my code
Rich (BB code):
Set sh1u = .Shapes.AddShape(msoShapeRoundedRectangle, 8.5, 8.5, 76.5, 28.5)
        sh1u.Name = "Up"
        With sh1u
        .Line.Visible = False
        With .TextFrame.Characters
            .Text = "RESET"
            With .Font
                .Name = "Calibri"
                .FontStyle = "Bold"
                .Size = 11
                .Color = RGB(255, 255, 255)
            End With
        End With
        With .ThreeD
            .BevelTopType = msoRelaxedBevel
            .BevelTopInset = 6.5
            .BevelTopDepth = 5
        End With
        .OnAction = "gui_reset"

Is anyone able to correct me on how to properly code the 3d propertires of this shape?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Or maybe .BevelTopType = msoBevelRelaxedInset
 
Upvote 0
Thank you. That worked, but now I wish to change it the simply round. I replaced msoBevelRelaxedInset with msoBevelRound and I have that error again. Where can I find reference to the different BevelTopTypes? The microsoft page I found for "MsoBevelType enumeration does not show msoBevelRelaxedInset let alone what I am looking for simply round.
 
Upvote 0
Use the macro recorder, that's what I did. ;)
 
Upvote 0
Yeah ... an often overlooked resource. Thanks. Who would have guessed a rounded rectangles is a msoBevelCircle?
 
Upvote 0
You're welcome & thanks for the feedback.

PS, I hope this has nothing to do with your thread on Excel Forum.
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,467
Members
448,965
Latest member
grijken

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