Hi All,
i need a way to alter the state of a workbook to "editable" then save and then switch back to "read only"
reason being is i need to hide tabs evertime the workbook is closed
any ideas are more than welcome
cheers for reading
Hi All,
i need a way to alter the state of a workbook to "editable" then save and then switch back to "read only"
reason being is i need to hide tabs evertime the workbook is closed
any ideas are more than welcome
cheers for reading
Last edited by Macdave_19; 04-23-2009 at 06:34 AM.
Mr MaGoo
Magoo.Inc MMVII
If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post
You could just place a macro to hide the tabs when the book is saved then, why do you need to make it read only?
Something like this in the 'ThisWorkbook' section of the VB Editor will hide teh sheets for you when saving:
Please Login or Register to view this content.
Nah phil,
you can't save the workbook in read only mode mate!
No, my question was more one of "Why do you need to make it read-only?"
Your original post gives the reason as needing to hide the tabs when you close the workbook, hence my original suggestion.
So are you wanting to hide the tabs and make it read-only when it is closed / saved ?
Then when you open it, manually make it editable again, and manually unhide the tabs?
right,
when a user opens the workbook they can either open it as read only or enter the password and edit it.
my workbook_open macro checks to see if it's read only or editable then undides the tabs if editable or hides if not editable.
my dilema come when people are prompeted to enable macro's at the begining.
if all tabs are visible when closed then it's pointless, hence the reason i want to be able to hide all tabs in read only, when saved.
i hope that's clear
How about this then?
On 'Save' it hides Worksheets 2 & 3, and saves the file with a readonly password set.
Password is "MaGoo"
Please Login or Register to view this content.
actually i've just sussed it!
if the workbook is editable then i can simpy hide the tabs then save meaning if it's opened without a password they will be hidden.
if the workbook is read only i don't need to save it as it'll already be hidden
your idea kind of cleared my mind for me there!!
this should work.
cheers
Correct, the above code will do what you need on a 'editable' workbook that is saved, and a readonly workbook can't have the tabs unhidden and saved anyway
Only thing that could 'break' this would be if someone opened it with write access, (using the password), but then didn't enable macros. If they then unhide the tabs, and save the workbook they will remain visible until the next time someone opens it with Write access and enables the macros, and saves
Not overly likely to happen, but just a possibility for you to look out for
i've thought of this and the only tab that isn't hidden is an info screen reminding folk to enable them and also a button for those who know the passowrd and want to edit it
cheers for your help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks