ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving an update file in same directory as older one (https://www.excelbanter.com/excel-programming/401807-saving-update-file-same-directory-older-one.html)

SyZyGy

Saving an update file in same directory as older one
 
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



Zone[_3_]

Saving an update file in same directory as older one
 
ThisWorkbook.Path will give you the path of the workbook with the program in
it. James

"SyZyGy" wrote in message
...
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






All times are GMT +1. The time now is 12:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com