I have a shape in excel which acts as a button to run a VBScript macro. I'd like to change the bevel and shadow while the macro is running to make it seem like the button was physically pressed. I feel like this should be an easy one to solve but I don't understand why my code isn't working:
Sub Welcome_Begin()
Sheets("Welcome").Select
With ActiveSheet.Shapes.Range(Array("Welcome_Begin_Button"))
.ThreeD.BevelTopInset = 0
.ThreeD.BevelTopDepth = 0
With .Shadow
.OffsetX = 0
.OffsetY = 0
End With
End With
Application.ScreenUpdating = False
< code goes here >
Sheets("Welcome").Select
Application.ScreenUpdating = True
With ActiveSheet.Shapes.Range(Array("Welcome_Begin_Button"))
With .Shadow
.OffsetX = 1.2246467991E-16
.OffsetY = 2
End With
.ThreeD.BevelTopInset = 1
.ThreeD.BevelTopDepth = 0.5
End With
End Sub
With this code, it should change the appearance of the button before pausing screen update and running the code. I have tested the upper and lower blocks individually to ensure that the code will correctly change the appearance of the button, so I don't know why the button doesn't change before pausing screen updates...
This is what it should look like when pressed:
Any ideas?