View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tony Alston Tony Alston is offline
external usenet poster
 
Posts: 2
Default FileCopy creates two files

Hi Mark,

I had thought of this earlier, but am unable to reproduce it stepping
line by line. It seems to happen only when executing the macro which
adds to the puzzlement. I thought that the path I had set in my
variables might have been the culprit, but I when including the path in
the statement to open the new file, it worked ok to open - but not when
activating different sheets.

ie:

templatedir = "C:\WINDOWS\desktop\hsgbdrwwis\"
targetfile = Trim(Sheet1.Cells(x, 1)) & ".xls"
targetfile = templatedir + targetfile

Workbooks.Open (targetfile) 'this worked
... 'yadda yadda code
Windows(targetfile).Activate 'this didn't

Any other thoughts? It's not a BIG deal (other than if it starts
writing over the top of the modified file with my blank template) but is
a curious anomoly.

-Tony


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!