Referncing Problem...

M

moon

Hi all,

I would really like the help for this problem, please!!!

In my XL macro, I am referncing another XL file to get some macros
from it. The problem is that one of these macros closes the XL file
that contains it. I could not modify this macro to prevent it from
doing that.

The problem is that I am getting an error which says that the file
could not be closed because it is being by other files (which is my
macro).

How can I solve this issue!? How can I call a macro from another file,
which closes the XL file that contains it without getting this
dependecny error!!!!

Tahnx in advance
 
D

Dave Peterson

I'm not sure you can stop this behavior.

Maybe you could remove the reference and whenever you wanted to call the macro
in the other workbook, open that workbook (if it's not open) and use:

application.run "'yourotherworkbookname.xls!yourothermacro"

instead of:

call yourothermacro
 
D

Dave Peterson

oops. I dropped an apostrophe in the previous post:

application.run "'yourotherworkbookname.xls!yourothermacro"
should be:
application.run "'yourotherworkbookname.xls'!yourothermacro"
 
Top