Access Statusbar in a specific workbook

ijourneaux

New Member
Joined
Jul 9, 2018
Messages
38
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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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