ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Share a workbook and protect (https://www.excelbanter.com/excel-programming/315856-share-workbook-protect.html)

Jasons

Share a workbook and protect
 

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

--
Jason
-----------------------------------------------------------------------
Jasons's Profile: http://www.excelforum.com/member.php...fo&userid=1610
View this thread: http://www.excelforum.com/showthread.php?threadid=27554


Dave Peterson[_4_]

Share a workbook and protect
 
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.





Jasons wrote:

I write some code in VBA to make a sheet automatically hide/unhide some
ranges according to a n input box. Also I want to protect some part of
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 their
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 my
"protect/unprotect" code in VBA conflicting with the Share Condition.

Any help?

Thanks

--
Jasons
------------------------------------------------------------------------
Jasons's Profile: http://www.excelforum.com/member.php...o&userid=16108
View this thread: http://www.excelforum.com/showthread...hreadid=275549


--

Dave Peterson



All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com