Cause & Solution if Getting Error Changing Statusbar in Excel 2010

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,030
I just thought I'd throw this up in a post since recently had a nice :banghead: session with this and I did a quick search here and don't see any threads that appear to warn of this. It's not likely to happen too often, but it's a bit of a pain in the tuckus when it does. (If you're not familiar with the whole ProtectedViewWindow object - it's what you get when you open an attachment from Outlook 2010.)
Code:
    '// if only a protected view and nothing else, then one cannot
    '// access the statusbar, if the active window is a PV then
    '// activeworkbook is nothing; so use that as the test.
    #If VBA7 Then
        With Application
            If .StatusBar <> False Then
                If Not .ActiveWorkbook Is Nothing _
                    Or (.ActiveWorkbook Is Nothing _
                        And .ProtectedViewWindows.Count = 0) Then
                    .StatusBar = False
                End If
            End If
        End With
    #Else
        Application.StatusBar = False
    #End If
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,225,609
Messages
6,185,980
Members
453,333
Latest member
BioCoder84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top