Saving an update file in same directory as older one

S

SyZyGy

I am looking for a macro to save an updated file (created from an older one
using a macro) in the same directory as the original. The newer file will
then transfer some of the data from the older file to the newer.

When I run the macro I created on my own PC from the directory where the
original file was created all is fine - new file created in same directory,
data transferred.

The problem starts when I transfer the file to another computer or even a
different directory and run the macro from there. The new file is still
created, but it appears in a different directory to the original and hence it
cannot identify where the original file is located.

Is there a macro to say 'create file in same directory as the old one'?

Putting in a specific path would not work as there is no guarantee that when
the file is transferred it will be in a specific location

Any help appreciated
 
Z

Zone

ThisWorkbook.Path will give you the path of the workbook with the program in
it. James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top