obriensj
12-19-2007, 03:45 AM
Hi,
Am a bit new to all this so any help much appreciated!
I need to design a macro that will open up numerous csv files stored on a server and save these as excel files overwriting the excel files already stored in a different path name on the server.
For example I may have 20 different csv files called:
cpcfibxgp181207a.csv (sample path name: J\shs\test\
cpcfidtrb181207a.csv (sample path name: J\shs\test\
and so on?what I need to do is save these files in this folder: J\upload\daily\
However in this folder there are already xls files here so what I need to do is take the csv file and parse the file name to bring in for example IBXGP from csv file: cpcfibxgp181207a.csv and save the file as IBXGP.xls overwriting the previous file from yesterday. Can this be done?
I think this is complicated by the fact that there are numerous csv files stored and knowing which one to pick up, for example:
cpcfibxgp181207a.csv
cpcfibxgp171207a.csv
cpcfibxgp161207a.csv
These are the last three days files and I need to be able to pick up the latest file, cpcfibxgp181207a.csv and save as IBXGP.xls overwriting the previous file in folder J\upload\daily\
Was thinking of starting with GetOpenfileName method but don?t think will work, any ideas anyone?
Thanks
Steve
Am a bit new to all this so any help much appreciated!
I need to design a macro that will open up numerous csv files stored on a server and save these as excel files overwriting the excel files already stored in a different path name on the server.
For example I may have 20 different csv files called:
cpcfibxgp181207a.csv (sample path name: J\shs\test\
cpcfidtrb181207a.csv (sample path name: J\shs\test\
and so on?what I need to do is save these files in this folder: J\upload\daily\
However in this folder there are already xls files here so what I need to do is take the csv file and parse the file name to bring in for example IBXGP from csv file: cpcfibxgp181207a.csv and save the file as IBXGP.xls overwriting the previous file from yesterday. Can this be done?
I think this is complicated by the fact that there are numerous csv files stored and knowing which one to pick up, for example:
cpcfibxgp181207a.csv
cpcfibxgp171207a.csv
cpcfibxgp161207a.csv
These are the last three days files and I need to be able to pick up the latest file, cpcfibxgp181207a.csv and save as IBXGP.xls overwriting the previous file in folder J\upload\daily\
Was thinking of starting with GetOpenfileName method but don?t think will work, any ideas anyone?
Thanks
Steve