#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Read Only

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!


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Read Only

dim wkbk as workbook
set wkbk = workbooks.open(filename:=yourpathandfilename, readonly:=true)
application.run "'" & wkbk.name & '!hiderow"





Gisela wrote:

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!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Read Only

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.


"Gisela" wrote:

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!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Read Only

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!

"Mike H" wrote:

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.


"Gisela" wrote:

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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read only file is NOT Read only Marilyn Excel Discussion (Misc queries) 1 November 18th 08 05:22 AM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
Read-write/Read-only Jillian Excel Discussion (Misc queries) 4 February 16th 06 05:26 PM
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" billybob Excel Discussion (Misc queries) 1 February 13th 06 03:14 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM


All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"