Dialogue Box Wont Dissapear In Time: VBA Help Needed

C

Celtic_Avenger

I have a code liked to a button on a dialog sheet.

When I select the button that runs the macro below, I ask for th
"MenuDialog" to dissapear before changing pages. I need this to happe
so that the comment indicator can be seen. With the code as it is th
MenuDialog stays on the screen until the very end of the code action.

Is there someway I can add something to ensure the MenuDialog is of
the screen before changing sheets?

Sub SaveButton()
ThisWorkbook.DialogSheets("MenuDialog").Hide
ActiveWorkbook.RefreshAll
ActiveWorkbook.Sheets("Dispatch").Select
ActiveSheet.Range("D1").Select
ActiveWindow.ScrollRow = 1
Application.DisplayCommentIndicator = xlCommentAndIndicator
Application.CommandBars("Reviewing").Visible = False
ActiveWorkbook.Save
Application.DisplayCommentIndicator = 0

End Sub

Hope someone can help.

Celtic_Avenger
:confused: :confused: :confused: :confused: :confused
 
T

Tom Ogilvy

Sub SaveButton()
ThisWorkbook.DialogSheets("MenuDialog").Hide
Application.ScreenUpdating = False
Application.ScreenUpdating = True
ActiveWorkbook.RefreshAll
ActiveWorkbook.Sheets("Dispatch").Select
ActiveSheet.Range("D1").Select
ActiveWindow.ScrollRow = 1
Application.DisplayCommentIndicator = xlCommentAndIndicator
Application.CommandBars("Reviewing").Visible = False
ActiveWorkbook.Save
Application.DisplayCommentIndicator = 0

End Sub

Might work.
Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top