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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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