View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default open two files with the same name concurrently

How about using VBA's FileCopy to make a copy of the second workbook. Name it
something that won't cause a problem.

Open that, copy, paste, close, and kill that copied file.



joanne wrote:

hi
For some reason, i have to write a macro to copy some ranges of two files with the same name but in different directories.
then paste them to target file. The process is quite simple but in Excel, open two files with the same name even from different directories is not allowed. Therefore, i figured out a compromised way to do is: open file1, copy and paste it
to target file; close file1. Then ask user to open file2; then press a command button to do the thing of copy and
paste it to the third file. Of course, it works fine but I still wanna know is there any better solution to do with this problem?

An ideal solution for me is user open two files concurrently then press a button that copy and paste to the target file.
Thank you very much.


--

Dave Peterson