VBA to Unprotect/Protect Worksheet - for a shared workbook

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
594
Office Version
  1. 365
I am not sure what I need is possible, but worth asking!

I have shared workbook that is also has the sheet protected (no password)

I have an existing macro that to run, needs to unprotect the worksheet, run, then protect again.

When not shared it works fine, but cannot run when shared (due to the unprotect/protect situation)

Any ideas, gratefully received!
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi - apologies had a chance to check this until now due to people being in it! If I do not open it as a shared workbook, it works fine. ThenI can share it. If I open it up as a shared book I get an error of "Application - Defined or object defined error." Is there a way on opening it can do the above code, and then automatically share the workbook please? (although I am guessing that this will not help as the workbook will be closed as "Shared"???
Did not read this before previous post.

If you unprotect the sheet and run te macro, do you ave the same error?
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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