Ho to update a label from a userform within a macro in a different Workbook?

holditall

New Member
Joined
Dec 30, 2008
Messages
17
Dear all,

I am trying to do a simple thing, namely updating a label like:


ProgressReport.Label12 = "Finished!"

This works fine as long as it is called from a macro within the same workbook. When I am doing it from another workbook it
get me an 424 Object required error, presumably because Excel does not know where the form is (even if it is already activated).

but neither:

Workbooks(" bbbb ").ProgressReport.Label12 = "Finished!"
Worksheets(" bbbb ").ProgressReport.Label12 = "Finished!"
Windows(" bbbb ").ProgressReport.Label12 = "Finished!"

etc. does work. Any ideas?

Thanks a lot!

Axel
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
i could be wrong. but there arn't suppose to be spaces at the workbook name line.
Should be
Workbooks("bbbb").ProgressReport.Label12 = "Finished!"
 
Upvote 0
Are the both workbooks open when the script is called?

If so, add the line below to your script:

Windows("WORKBOOK NAME HERE.xls").Activate
 
Upvote 0
This does not help.

I can indeed even change my userform when a another Window is open as long it is done by a macro within that workbook. It is just that I can not call the label since the code is in another Workbooks Module.

Axel
\
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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