ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   change directory for refresh data (https://www.excelbanter.com/excel-discussion-misc-queries/11961-change-directory-refresh-data.html)

TxRaistlin

change directory for refresh data
 
Hello again everybody.

I've gotten some help on this and it was greatly appreciated. one more
quick question:

I have an excel 2002 file with several sheets that reference external files
with the extension *.out.

I would like to be able to copy this excel file to a new directory and then
update the file after opening it by referencing the *.out files in the
current directory with the same names. i.e. the path of the reference files
and the primary excel file changes but nothing else, their names and
formatting will be the same. The old data from the previous directory would
be replaced by the update process.

Is there a way this can be automated through a macro?

I tried recording a macro of the file update process and changing the
reference path, but only the following was recorded:

Sub update_directory_info()
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Obviously the above does not include the change to the path reference.

There aren't any other external references in the file, so a global path
change would be possible.

The files being referenced are fixed width, but each sheet already has
certain criteria assigned for import of the data and i would like to retain
that.

Once again, I would greatly appreciate the help.

Thanks,

Jason


All times are GMT +1. The time now is 09:47 AM.

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