Macro to open another file

F

Francis Hookham

Macro to open another file



Macros in ADR.xlt open a single sheet workbook named ADR.xls and save it as
060330 ADR (YYMMDD ADR)



A macro is then needed to open a file named AgedDebtorReport.csv and copy
data back into the ADR.xls sheet



A new AgedDebtorReport.csv file is downloaded from the net into the same
folder each day - the name is the same each day



ADR.xlt will sometimes be moved from one computer to another and between Mac
and PC, in the first case from mine to the friend's for whom I am writing
the macros



Recording the file path:



ChDir "D:\Documents and Settings\Francis\`Tyler"

Workbooks.Open Filename:= _

"D:\Documents and Settings\Francis\`Tyler\AgedDebtorReport.csv"



and cutting it down to



Workbooks.Open Filename:="AgedDebtorReport.csv"



works well until I close XL and try again - there's obviously more to paths
that I know about!



Can the "AgedDebtorReport.csv" file (changed daily, with the same name and
held in the same folder) be opened by the macro in the "YYMMDD ADR"
spreadsheet which was generated by the original ADR.xls?



Or am I hoping for too much?



Any difference between Mac and PC code/working - I am developing this on PC
but it will have to run on Mac as well



Thanks - as always



Francis Hookham
 

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