View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
LEO@KCC LEO@KCC is offline
external usenet poster
 
Posts: 9
Default Application.StatusBar not refreshing after ThisWorkbook.Close

Hi,

Could someone please explain the following behaviour?

The Workbook_BeforeClose event is triggered after the ThisWorkbook.Close
method is called and all lines in the Event sub are executed but the status
bar never actually changes its text, and no exceptions are thrown either.

Add this to the ThisWorkbook module and test:

Sub RunThisMacro()
Application.StatusBar = Rnd
ThisWorkbook.Close
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.StatusBar = "THIS DOES NOT WORK" 'this is executed but it
doesn't actually do anything.
End Sub

Thanks for your insight.

Leo