I'm trying to create a subroutine (actually two)
The first finds the coordinates of the frame and stores the value, then sets the values I need to explode the frame size.
Sub displayframe(frm As msforms.Frame)
With frm
ht = .Height
wdth = .Width
Tp = .Top
lft = .Left
.Height = 300
.Width = 550
.Top = 140
.Left = 50
frm.Visible = True
End With
End Sub
And the second restores the original coordinates:
Sub restoreframe(frm As msforms.Frame)
With frm
.Height = ht
.Width = wdth
.Top = Tp
.Left = lft
End Sub
I'm calling the subroutines with:
displayframe (Me.Neuroframe)
restoreframe (Me.Neuroframe)
I'm getting the error "type mismatch"
What am I doing wrong here? I'm creating subroutine typed for a frame and I'm passing it a frame. Thanks to all who reply!
The first finds the coordinates of the frame and stores the value, then sets the values I need to explode the frame size.
Sub displayframe(frm As msforms.Frame)
With frm
ht = .Height
wdth = .Width
Tp = .Top
lft = .Left
.Height = 300
.Width = 550
.Top = 140
.Left = 50
frm.Visible = True
End With
End Sub
And the second restores the original coordinates:
Sub restoreframe(frm As msforms.Frame)
With frm
.Height = ht
.Width = wdth
.Top = Tp
.Left = lft
End Sub
I'm calling the subroutines with:
displayframe (Me.Neuroframe)
restoreframe (Me.Neuroframe)
I'm getting the error "type mismatch"
What am I doing wrong here? I'm creating subroutine typed for a frame and I'm passing it a frame. Thanks to all who reply!