Need VBA Code for Status Bar Message

  • Thread starter Thread starter Cathy
  • Start date Start date
C

Cathy

Hi,

I have a macro that searches and replaces a lot of company-specific
terminology. It's difficult to know whether the macro is working or not,
because you don't get an hour glass or anything. I've added a message box
that states when the macro is completed, but now I would like to add a
message in the status bar that states that the macro is in progress (or some
sort of message somewhere stating that the macro is in progress). Some of
the presentations that the macro has to search through are large and it
would be helpful for the user to know that the macro is really going and
that they haven't bombed out.

I've put this code in Word macros before, but I'm not sure how to do it in
PowerPoint, or if it is even possible. Any help would be greatly
appreciated. Thanks for your time!

Cathy
 
Cathy,
Shyam may correct me but I don't think Application.StatusBar is
available in any version of PPT yet.

Depending on which version you are using you might be able to throw up
a modal textbox to perform the same function. Shyam or Chirag, you
guys sitting on any sample code for this. I'm not since I've been
buried in SQL Server and IIS lately (g).

Cathy, reply with what version of PPT you are using since modal
textboxes are relatively new.

Brian Reilly, PowerPoint MVP
 
I guess the best solution would be to show the status messages in non-modal
user forms. Create a user form with a textbox on it to hold the status
messages. Show the user form using something like:

UserForm.Show vbModeless

Update the textbox on the user form with status messages at appropriate
intervals. Sprinkle the code with some "DoEvents" - one atleast after
updating the status textbox. When you are done with searching, hide the user
form with:

UserForm.Hide

If you are not going to use the userform again, might as well unload it:

Unload UserForm

If you really really want to update the status bar, Win32 API could probably
be used.

- Chirag

PowerShow - View multiple shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
Hi,

I have a macro that searches and replaces a lot of company-specific
terminology. It's difficult to know whether the macro is working or not,
because you don't get an hour glass or anything. I've added a message box
that states when the macro is completed, but now I would like to add a
message in the status bar that states that the macro is in progress (or some
sort of message somewhere stating that the macro is in progress). Some of
the presentations that the macro has to search through are large and it
would be helpful for the user to know that the macro is really going and
that they haven't bombed out.

PowerPoint doesn't let you write to the status bar.

Will this only run in PowerPoint 2000 and up, or does it have to work in
PowerPoint 97 also? In the former, you can have modeless userforms (ie, they
don't block all other code execution while they're up).

You can have a small form with two labels, one atop the other, to represent
current state and 100% respectively. Change the "current state" label's width
from 0 to the same as the 100% label's width depending on how far along you
are.



--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Sorry, I meant to state what version of PowerPoint I was using in my
original message. It's 2002.
 
Hi Chirag,

I followed your instructions below and all except one thing is working well.
The userform shows up while the macro is running in the background and then
unloads at the right time. The only problem that I'm having is with the
text that is in the text box of the user form. It is not showing up when
the userform displays. The userform with its caption displays, but the area
where the message is supposed to be is blank. I've looked at everything I
can think of to try and figure out why this is happening -- font color,
background color, etc. I thought maybe I needed to "bring to front" or
"send to back" the text box, but all of the options for doing this (toolbar
and menu) are dimmed out.

In further testing, I switched the userform from being modeless to modal to
see if the text would show when the form displayed and it did. But, when I
put the form back to modeless, the text will not show. Do you have any idea
why this is happening?

Cathy
 
Hi Chirag,

Everything is working now. It was my own fault, because I neglected to put
in the "do events" that you mentioned in your initial response to me.

Thank you so much for your help, and for helping me to learn more about
VBA!!

Cathy
 
Back
Top