Get the string of the statusbar

  • Thread starter Thread starter RB Smissaert
  • Start date Start date
R

RB Smissaert

Using Excel XP and 2003.
Is there any way to get the message of the statusbar into a string variable?
It doesn't seem you can as the documentation says that if Excel has control
over the statusbar the return value is False and that is indeed so.
The reason why I am interested to get this string is that I have to make a
new
statusbar message out of the existing one plus another string.
Would any API method help here?

RBS
 
Hi RBS,

Sub DemoStatusbar()
Dim aStr As String
Debug.Print Application.StatusBar
Application.StatusBar = "My Message"
Debug.Print Application.StatusBar
aStr = Application.StatusBar & " to the world"
Application.StatusBar = aStr
Debug.Print Application.StatusBar
applicationstatusbar = ""
Debug.Print Application.StatusBar
End Sub
 
Yes, that works.
In my case though I need to retain the sheet filter message (19 of 26
records found) that is
displayed in the statusbar and with that it doesn't work.
I have managed to get the window handle of the statusbar, but I have come no
further yet.

RBS
 
I could do that, but there is not always a filter message in the statusbar,
so I
would have to make code for a number of different situations, complicating
matters.
Still it might be the easiest option indeed.

RBS
 
No there isn't (always a filter message) - so that is why it seems better to
do your own count. I am not sure how you would consider applying a filter
and then not performing your action because there is no filter message. The
cases where it doesn't show has more to do with the content of the range
being filtered (as opposed to the results) than anything to do with the
operation of the filter, so not sure why that is an appropriate condition
for action or inaction.
 

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

Back
Top