MKC
07-28-2009, 03:50 AM
Hello everybody!
I am trying copy data from one exel file to the other, the source file being closed. This works quite well, and the macro I found is even able to copy ranges from the closed file to the open one.
As the size and the starting point of the range, that is to be copied, varies from time to time, I thought it smart to define a name in the (closed) source sheet. This name ("start") basically is the name for the cell where my macro is suppossed to start copying the data.
Well, it turned out, that this wasn't actually that smart; or at least I am not able to extract the names reference.
This is my code:
Reference = Application.Workbooks("data.xls").Names("start").RefersToR1C1
It will work if the source file is (data.xls) open, but not if it is closed.
Do you have any ideas how to solve this problem?
Or am I just stupid by sticking to the idea that I wanna do all the importing/copying with the source file being closed?
Or do you have an idea how I could import from a dynamic range without using names defining the starting position?
Thanks a lot for all help! :-)
I am trying copy data from one exel file to the other, the source file being closed. This works quite well, and the macro I found is even able to copy ranges from the closed file to the open one.
As the size and the starting point of the range, that is to be copied, varies from time to time, I thought it smart to define a name in the (closed) source sheet. This name ("start") basically is the name for the cell where my macro is suppossed to start copying the data.
Well, it turned out, that this wasn't actually that smart; or at least I am not able to extract the names reference.
This is my code:
Reference = Application.Workbooks("data.xls").Names("start").RefersToR1C1
It will work if the source file is (data.xls) open, but not if it is closed.
Do you have any ideas how to solve this problem?
Or am I just stupid by sticking to the idea that I wanna do all the importing/copying with the source file being closed?
Or do you have an idea how I could import from a dynamic range without using names defining the starting position?
Thanks a lot for all help! :-)