Read Only

  • Thread starter Thread starter Gisela
  • Start date Start date
G

Gisela

I have a macro that is called from different workbooks. This macro hides
unused rows. It was define as Sub HideRow() in Module 2 of Entity_LOB_PST
file.

If more than one person is calling the macro from different workbooks, they
get a message “file is being used by another userâ€.

The macro is called from the different workbooks using the following
statement:
Application.Run "'" & Path2 & "Entity_LOB_PST.xls" & "'!HideRow"
where Path2 is the location of file Entity_LOB_PST

Is there any way to eliminate this message an open the macro as read only?
Please, help!
 
dim wkbk as workbook
set wkbk = workbooks.open(filename:=yourpathandfilename, readonly:=true)
application.run "'" & wkbk.name & '!hiderow"
 
Hi,

I would be most surprised if this was possible, I've certainly never heard
of it being done. I think the major problem is the variables in the macro,
how would the code be written to cope if 2 users were running it and
simultaneously wanted the same variable to hold different values.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
It works and it deletes unused rows. Right now they have to select read only
in the Excel msg. I just want to avoid that step to them. Is it possible?

Thanks!
 
Back
Top