Access Statusbar in a specific workbook

ijourneaux

New Member
Joined
Jul 9, 2018
Messages
36
I often have several workbooks open. When I run one of my macros, I output to the Statusbar using Application.StatusBar but that output to the statusbar in all of my workbooks. Is there a way to specif which statusbar you want to output to?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
No. The statusbar is an application property, and so runs on the application, Excel.

What you can do is modify the statusbar when you activate or deactivate the particular Excel window (workbook)

So say that you have workbooks 1, 2 and 3 open. The statusbar is changed by the macro in WB1. When the user switches to another workbook, the workbook.deactivate event happens in WB1. Here you could store the current statusbar and reset the statusbar to default.

Then later when the user returns to WB1, the workbook.activate event happens. Here you can then set the statusbar back to the stored value.

Would that work for you?

You get to the workbook events by double clicking ThisWorkbook under the workbook name in the left top window of the VBA editor. Then select workbook from the left dropdown above the macro pane and next select the activate and deactivate events from the right dropdown
 
Upvote 0

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

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