Jens W.
Jens W.

Reputation: 81

How to change Forms 2.0 BorderStyle with VBA?

I want to show/hide the border of "Microsoft Forms 2.0 Label" I use in Excel.

I can manually change the borderstyle from 0 - fmBorderStyleNone to 1 - fmBorderStyleSingle. What I would have liked is to span from 10 to 20 form 2.0 Shapes. So this makes no fun.

It should go, if this is right … like this

For Each sh In .Shapes
    .Select         ' just for debugging
    Select Case sh.Type
        Case 12     ' 2.0 Forms Label
            sh.BorderStyle = 0
    End Select
Next sh

How to change Forms 2.0 BorderStyle with VBA?

Upvotes: 4

Views: 594

Answers (1)

EvR
EvR

Reputation: 3498

Try:

For Each sh In .Shapes
    .Select         ' just for debugging
    Select Case sh.Type
        Case 12     ' 2.0 Forms Label
            sh.OLEFormat.Object.Object.BorderStyle = 0
    End Select
Next sh

Upvotes: 2

Related Questions