MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro to open as read only


Posted by RoB on February 06, 2002 5:48 PM

Hi everyone,

I have a problem. I have a database of names in one excel file. I have another file, which contains a macro that writes names to this file automatically. I want to know how it is possible to give 10+ people access to this file to search the names in it, but at the same time, have the ability to write new data to the database.

I was thinkig about everyone opening the file as read-only, so that the original could still be written to by the other macro, but how do I get the file to be opened read-only to everyone who wants to search it, but NOT read-only to the macro that needs to write to it?

Any help is appreciated, thanks!


Posted by Jacob on February 06, 2002 6:45 PM

Hi

This will open as read only

Workbooks.Open Filename:="C:\Documents\MyFile.XLS", ReadOnly:=True


HTH

Jacob

Posted by RoB on February 06, 2002 7:42 PM

wow, that easy, thanks!