Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto open workbook to make read-only
I want to manually open a protected workbook and for it to open read-only
with out a dialog box. If the above requires the use of the auto_open event, how do I turn this off when I open the protected workbook programmatically? I'm using excel 2003 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto open workbook to make read-only
For an old post:
Option Explicit Sub auto_open() Dim resp As Long If ThisWorkbook.ReadOnly = True Then 'they opened it readonly 'do nothing Else resp = MsgBox(Prompt:="What to change it to readonly?", _ Buttons:=vbYesNo) If resp = vbYes Then ThisWorkbook.ChangeFileAccess xlReadOnly End If End If End Sub Hit Alt+F11, double-click 'ThisWorkbook' and paste the code in there. Finally, File|SaveAs|tools|general options|check that "read-only recommended" box. Good luck, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Tim C" wrote: I want to manually open a protected workbook and for it to open read-only with out a dialog box. If the above requires the use of the auto_open event, how do I turn this off when I open the protected workbook programmatically? I'm using excel 2003 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto open workbook to make read-only
FROM an old post...
http://www.microsoft.com/office/comm...=en-us&m=1&p=1 Should have just pasted the link in there last time... Best of luck to you! Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "ryguy7272" wrote: For an old post: Option Explicit Sub auto_open() Dim resp As Long If ThisWorkbook.ReadOnly = True Then 'they opened it readonly 'do nothing Else resp = MsgBox(Prompt:="What to change it to readonly?", _ Buttons:=vbYesNo) If resp = vbYes Then ThisWorkbook.ChangeFileAccess xlReadOnly End If End If End Sub Hit Alt+F11, double-click 'ThisWorkbook' and paste the code in there. Finally, File|SaveAs|tools|general options|check that "read-only recommended" box. Good luck, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Tim C" wrote: I want to manually open a protected workbook and for it to open read-only with out a dialog box. If the above requires the use of the auto_open event, how do I turn this off when I open the protected workbook programmatically? I'm using excel 2003 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto open workbook to make read-only
Thanks for the help but this does not suppress the initial dialogue box
asking to read only or not. Also sub auto-open() does not work for me whereas sub workbook auto_open does? Why is this? The only way I can get around this is not to have the workbook saved password protected or readonly but make it readonly automatically on the auto-open using the code: Private Sub Workbook_Open() ThisWorkbook.ChangeFileAccess xlReadOnly End Sub Cheers, Tim ryguy7272" wrote: For an old post: Option Explicit Sub auto_open() Dim resp As Long If ThisWorkbook.ReadOnly = True Then 'they opened it readonly 'do nothing Else resp = MsgBox(Prompt:="What to change it to readonly?", _ Buttons:=vbYesNo) If resp = vbYes Then ThisWorkbook.ChangeFileAccess xlReadOnly End If End If End Sub Hit Alt+F11, double-click 'ThisWorkbook' and paste the code in there. Finally, File|SaveAs|tools|general options|check that "read-only recommended" box. Good luck, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Tim C" wrote: I want to manually open a protected workbook and for it to open read-only with out a dialog box. If the above requires the use of the auto_open event, how do I turn this off when I open the protected workbook programmatically? I'm using excel 2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use hyperlink to open workbook read only? | Excel Discussion (Misc queries) | |||
How to Protect my workbook (make it read only for users) | Excel Discussion (Misc queries) | |||
Read Only Message for open workbook | Excel Programming | |||
Make excel open file without Read Only dialog | Excel Discussion (Misc queries) | |||
workbook open read only without prompt | Excel Programming |