ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open to modify (https://www.excelbanter.com/excel-programming/449246-open-modify.html)

kardifflad

Open to modify
 
I'm hoping this is an easy one for someone.
I have a macro that writes data to an archive sheet every time a button is pressed. This works fine.
However I now want the archive sheet viewable to everyone but only updateable by either the marco or a password.
to do this i have saved the Archive with a password to modify. That way users can open as read only. However i do not know what addition i need to make to my macro for it to open the Archive to add data to it.
So for instance i currently have:

Workbooks.Open (ExcelFileB), Password:= "12345"

but this is no help with the read only setting. I thought perhaps it would be a simple Workbooks.Modify, password "12345". or something like that.

can anyone help please?
PS this is Excel 2003

GS[_2_]

Open to modify
 
Try...

Workbooks.Open (ExcelFileB), Password:= "12345", ReadOnly:=False

...since it is one of the args for the Open method. It would serve you
well to get familiar with the Object Browser!!!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



kardifflad

thank you for this, although its not quite addressing the problem. but this could be my fault in not having the write to document set as read only.

GS[_2_]

Open to modify
 
thank you for this, although its not quite addressing the problem.
but this could be my fault in not having the write to document set as
read only.


What about applying sheet protection? This requires users to enter a
password in order to edit content. VBA can edit if you set it up
correctly and lock the project.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 12:39 PM.

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