Opening macro file as read only

F

Fred Smith

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?
 
N

NickHK

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
 
F

Fred Smith

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 said:
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 said:
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?
 
N

NickHK

Well, how is your button opening the file ?

NickHK

Fred Smith said:
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 said:
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 said:
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?
 
F

Fred Smith

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 said:
Well, how is your button opening the file ?

NickHK

Fred Smith said:
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 said:
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

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?
 
T

Tom Ogilvy

go into windows explorer, select the file, right click and select
properties. Change it to Read Only.

--
Regards,
Tom Ogilvy


Fred Smith said:
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 said:
Well, how is your button opening the file ?

NickHK

Fred Smith said:
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


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

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?
 
F

Fred Smith

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 said:
go into windows explorer, select the file, right click and select properties.
Change it to Read Only.

--
Regards,
Tom Ogilvy


Fred Smith said:
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 said:
Well, how is your button opening the file ?

NickHK

"Fred Smith" <[email protected]>
¼¶¼g©ó¶l¥ó·s»D:[email protected]...
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


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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top