+ Reply to Thread
Results 1 to 5 of 5

Application.DisplayStatusBar

  1. #1
    Registered User
    Join Date
    07-05-2005
    Posts
    24

    Application.DisplayStatusBar

    I want to write to the status bar to assure the user that my macro is still running and the program hasn't crashed. From the Excel help files, I have the following:

    saveStatusBar = Application.DisplayStatusBar
    Application.DisplayStatusBar = True

    My question is about the saveStatusBar variable. I always use Option Explicit in the declarations section, so I need to define this variable, but I'm not sure what kind of variable it is. I know that for the sake of performance, I should avoid defining it as a Variant, so what should it be?

  2. #2
    Registered User
    Join Date
    07-05-2005
    Posts
    24
    I defined at as a Boolean and everything is working fine.

  3. #3
    Rowan
    Guest

    RE: Application.DisplayStatusBar

    Assuming you are just wanting to change the text on the statusbar as apposed
    to hiding and showing the statusbar itself you don't have to declare any
    variables. You just change the text as follows:

    Application.StatusBar = "Working..."

    'Rest of code here

    Application.StatusBar = False 'returns control to Excel

    Hope this helps
    Rowan


    "shellshock" wrote:

    >
    > I want to write to the status bar to assure the user that my macro is
    > still running and the program hasn't crashed. From the Excel help
    > files, I have the following:
    >
    > saveStatusBar = Application.DisplayStatusBar
    > Application.DisplayStatusBar = True
    >
    > My question is about the saveStatusBar variable. I always use Option
    > Explicit in the declarations section, so I need to define this
    > variable, but I'm not sure what kind of variable it is. I know that
    > for the sake of performance, I should avoid defining it as a Variant,
    > so what should it be?
    >
    >
    > --
    > shellshock
    > ------------------------------------------------------------------------
    > shellshock's Profile: http://www.excelforum.com/member.php...o&userid=24935
    > View this thread: http://www.excelforum.com/showthread...hreadid=392016
    >
    >


  4. #4
    JMB
    Guest

    RE: Application.DisplayStatusBar

    It's boolean.

    If you type

    ?application.displaystatusbar

    in the Immediate Window (in VBA) it will return True or False depending on
    the current state of your statusbar.



    "shellshock" wrote:

    >
    > I want to write to the status bar to assure the user that my macro is
    > still running and the program hasn't crashed. From the Excel help
    > files, I have the following:
    >
    > saveStatusBar = Application.DisplayStatusBar
    > Application.DisplayStatusBar = True
    >
    > My question is about the saveStatusBar variable. I always use Option
    > Explicit in the declarations section, so I need to define this
    > variable, but I'm not sure what kind of variable it is. I know that
    > for the sake of performance, I should avoid defining it as a Variant,
    > so what should it be?
    >
    >
    > --
    > shellshock
    > ------------------------------------------------------------------------
    > shellshock's Profile: http://www.excelforum.com/member.php...o&userid=24935
    > View this thread: http://www.excelforum.com/showthread...hreadid=392016
    >
    >


  5. #5
    Registered User
    Join Date
    07-05-2005
    Posts
    24
    Thanks for the clarification, JMB.

    Rowan, I do want to save the current display status of the status bar, so that I can restore the original display status after my program has run its course. That's why I need the variable.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1