purpleozzie
Board Regular
- Joined
- Jun 8, 2015
- Messages
- 64
Hi,
I've assigned the following macro to a shape.. I want to simulate a button click when the shape is pressed hence the reason I've called simulatebutt*******
This only works when I remove the application.screenupdating = false line.. but this line comes below the Call simulatebutt******* line..
The simulatebutt******* maro looks like this:
Not sure why this is happening, can anyone see what I'm doing wrong...
I've assigned the following macro to a shape.. I want to simulate a button click when the shape is pressed hence the reason I've called simulatebutt*******
Code:
Sub FREEZE()
Call SimulateButt*******
Application.ScreenUpdating = False
ActiveSheet.Shapes.Range(Array("Rounded Rectangle 28")).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = "UNFREEZE"
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 8). _
ParagraphFormat
.FirstLineIndent = 0
.Alignment = msoAlignCenter
End With
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 8).Font
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorLight1
.Fill.ForeColor.TintAndShade = 0
.Fill.ForeColor.Brightness = 0
.Fill.Transparency = 0
.Fill.Solid
.Size = 13
.Name = "+mn-lt"
Selection.OnAction = "UNFREEZE"
End With
ActiveWindow.ScrollRow = 1
ActiveWindow.SmallScroll Down:=13
Rows("19:19").Select
ActiveWindow.FreezePanes = True
Range("A19").Select
Application.ScreenUpdating = True
End Sub
This only works when I remove the application.screenupdating = false line.. but this line comes below the Call simulatebutt******* line..
The simulatebutt******* maro looks like this:
Code:
Sub SimulateButt*******()
Dim vTopType As Variant
Dim iTopInset As Integer
Dim iTopDepth As Integer
Application.ScreenUpdating = False
'Record original button properties
With ActiveSheet.Shapes(Application.Caller).ThreeD
vTopType = .BevelTopType
iTopInset = .BevelTopInset
iTopDepth = .BevelTopDepth
End With
'Button Down
With ActiveSheet.Shapes(Application.Caller).ThreeD
.BevelTopType = msoBevelSoftRound
.BevelTopInset = 12
.BevelTopDepth = 4
End With
Application.ScreenUpdating = True
'Button Up - set back to original values
With ActiveSheet.Shapes(Application.Caller).ThreeD
.BevelTopType = vTopType
.BevelTopInset = iTopInset
.BevelTopDepth = iTopDepth
End With
End Sub
Not sure why this is happening, can anyone see what I'm doing wrong...