View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Fred Smith Fred Smith is offline
external usenet poster
 
Posts: 623
Default Opening macro file as read only

Thanks, Tom. At least that gives me a workaround.

I have all my macros in one file, and some of them need to do saves. So the one
that gets used simultaneously, I can just move to another file that I'll set as
read only.

--
Regards,
Fred


"Tom Ogilvy" wrote in message
...
go into windows explorer, select the file, right click and select properties.
Change it to Read Only.

--
Regards,
Tom Ogilvy


"Fred Smith" wrote in message
...
You customize the toolbar, right click on the command button, and assign a
macro to it, which includes the file name.

Excel opens the file to execute the macro. How do I tell Excel to open the
file read only?

--
Regards,
Fred


"NickHK" wrote in message
...
Well, how is your button opening the file ?

NickHK

"Fred Smith"
bl...
I know how to open a file read only within the macro, but I'm talking about
the initial execution of the macro.

I put a custom button on the tool bar, and assign a macro, can I tell the
custom button to open the file read only?

--
Regards,
Fred


"NickHK" wrote in message
...
Fred,
Look at the 3rd argument to the .Open method :
<From the Object Browser
Function Open(Filename As String, [UpdateLinks], [ReadOnly],

Alternatively, make your file a template with the .xlt extension, then a
copy of the WB is opened each time instead of the actual WB.

NickHK

"Fred Smith" wrote in message
...
I have a macro which is executed via a custom button. It's often used on
more
than one workstation at a time. The problem is that the second user gets
a
'file
in use' error. Fortunately, they're allowed to choose to open it Read
Only,
which solves the problem.

I'd like to avoid the error message if possible. Is there any way to tell
a
custom button to open the file Read Only?

--
Regards,
Fred