set workbook that is open to read only

dialup

Board Regular
Joined
Jan 10, 2008
Messages
99
Hi
I have a (nearly completed thanks to this site) workbook, i am using
Code:
 Set myShell = CreateObject("WScript.Shell")
ItsMe = myShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultUserName")
Set myShell = Nothing
    Sheet1.Range("c2") = ItsMe

to identify who is opening the workbook and writing their id to a cell which is then used in a vlookup to determin if they are denied access, granted but on read only or given full access. the code triggered by the the worbook_open event so the workbook is already open.

I can deyy access (close the workbook) and allow access (do nothing) but can an open workbook be set to read only?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,191,190
Messages
5,985,200
Members
439,947
Latest member
fabiannic

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
Top