How to run Macros in Shared workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have created a shared workbook, containing protected worksheets with Macros.
By wrapping the Macro codes with as follow:

Sheets("My Sheet").Unprotect("My password")
Macro Code
Sheets("My Sheet").Protect("My password")

my macros work when the Workbook(Not Shared) is on the shared drive of my
Company.
When I set it as Shared Workbook, I receive an error message.
Can Someone Help me on this matter ?

Thanks in advance

regards

Paul.
 
There are some things you can't do in shared workbooks. One of them is changing
the protection of a worksheet.

The only workarounds I know are:

Don't share the workbook
or
Don't protect the worksheet.

Take a look at excel's help:
Features that are unavailable in shared workbooks

And you'll a list.
 
Dave Peterson said:
There are some things you can't do in shared workbooks. One of them
is changing the protection of a worksheet.

The only workarounds I know are:

Don't share the workbook
or
Don't protect the worksheet.

Take a look at excel's help:
Features that are unavailable in shared workbooks

And you'll a list.

Or un-share it, run the code, and share again?

However, that will take a noticeable amount of time for the user.

HTH,

Alan.
 
But bad things could happen.

Change history will be gone. And any other user currently editing the file
won't be able to save their changes--even after you reshare it.
 
Dave Peterson said:
But bad things could happen.

Change history will be gone. And any other user currently editing
the file won't be able to save their changes--even after you reshare
it.

Good points!

Alan.
 
Back
Top