Share a workbook and protect

J

Jasons

I write some code in VBA to make a sheet automatically hide/unhide som
ranges according to a n input box. Also I want to protect some part o
the sheet so that the values can only be viewed but not editable
Finally I share the workbook to a group so that others can enter thei
names to edit their own part of the sheet.

Questions:

I do not know how to share a workbook in VBA code.

If I share the workbook without VBA, I found that m
"protect/unprotect" code in VBA conflicting with the Share Condition.

Any help?

Thank
 
D

Dave Peterson

Start a new workbook and turn on the macro recorder (so the code gets recorded
in this "helper" workbook.)

Then swap back to your real workbook (unshare it first) and share it.

I get this code:

ActiveWindow.ActivateNext
ActiveWorkbook.KeepChangeHistory = True
ActiveWorkbook.SaveAs Filename:="C:\My Documents\excel\book5.xls", _
AccessMode:=xlShared

But the other question is a problem. You can't change protection of a worksheet
within a shared workbook. (and that applies no matter how you applied
sharing--via the user interface or via code.)

Look in Excel's help for "Features that are unavailable in shared workbooks"

You may be disappointed in all the things you can't do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top