S
shelfish
Good Monday all!
Dilemma d'jour: While running a macro, I need it to pause and allow
the user to make some changes to the spreadsheet....
************************************************************************
Sub waitForComments()
Dim btnRESUME As CommandBarControl
On Error Resume Next
'ADD BUTTON TO EXISTING CUSTOM MENU THAT ALLOWS USER TO RESUME MACRO
Set btnRESUME = Application.CommandBars("Worksheet Menu
Bar").Controls("My Custom Menu").Controls.Add(Type:=msoControlButton,
Temporary:=True)
With btnRESUME
.Caption = "RESUME"
'ANOTHER SUB SETS i = 1
.OnAction = "catchBtnRESUME"
End With
i = 0
Do Until i = 1
DoEvents
Loop
btnRESUME.Delete
On Error GoTo 0
End Sub
**************************************************************************************
The problem here is that, intermittently, the "My Custom Menu" is
missing completely. The 'Worksheet Menu Bar' still includes the
'charts' sub menu which must be the result of the fact that my
workbook has several charts and worksheets that it moves between. But
it will not update the menu bar as it does so. So the end user has no
way of clicking the "RESUME" button to continue through the macro.
Any thoughts on how I could force a refresh before starting the
DoEvents loop?
Many thanks in advance for the assistance.
S.
Dilemma d'jour: While running a macro, I need it to pause and allow
the user to make some changes to the spreadsheet....
************************************************************************
Sub waitForComments()
Dim btnRESUME As CommandBarControl
On Error Resume Next
'ADD BUTTON TO EXISTING CUSTOM MENU THAT ALLOWS USER TO RESUME MACRO
Set btnRESUME = Application.CommandBars("Worksheet Menu
Bar").Controls("My Custom Menu").Controls.Add(Type:=msoControlButton,
Temporary:=True)
With btnRESUME
.Caption = "RESUME"
'ANOTHER SUB SETS i = 1
.OnAction = "catchBtnRESUME"
End With
i = 0
Do Until i = 1
DoEvents
Loop
btnRESUME.Delete
On Error GoTo 0
End Sub
**************************************************************************************
The problem here is that, intermittently, the "My Custom Menu" is
missing completely. The 'Worksheet Menu Bar' still includes the
'charts' sub menu which must be the result of the fact that my
workbook has several charts and worksheets that it moves between. But
it will not update the menu bar as it does so. So the end user has no
way of clicking the "RESUME" button to continue through the macro.
Any thoughts on how I could force a refresh before starting the
DoEvents loop?
Many thanks in advance for the assistance.
S.