Moving File Inside of Excel

D

David Langschied

I am importing a file into Excel. Once I do this, I would like to move that
file to an archive directory and rename it by adding the date to the file
name. I am sure that I can handle the rename as soon as I can get teh move
going. You guys have been so helpful in the past, I thought I would toss it
out ot you for help.

Regards,
David Langschied
 
B

Bob Greenblatt

I am importing a file into Excel. Once I do this, I would like to move that
file to an archive directory and rename it by adding the date to the file
name. I am sure that I can handle the rename as soon as I can get teh move
going. You guys have been so helpful in the past, I thought I would toss it
out ot you for help.

Regards,
David Langschied
Have you not tried Save-As? If this is not working, what's happening that is
not what you want to do?
 
D

David Langschied

I should have been more clear. I wish to do this from inside of a module in
Excel, VB. I want it in the background. I have got the code to do it, but
ran into another issue.

First,
I am using name:
name LoadFile as ArchFile

But now, if the file does not exist, I get an error. My issue now is "How
doe I see if a file exists from inside of Excel using VB?
 
B

Bob Greenblatt

I should have been more clear. I wish to do this from inside of a module in
Excel, VB. I want it in the background. I have got the code to do it, but
ran into another issue.

First,
I am using name:
name LoadFile as ArchFile

But now, if the file does not exist, I get an error. My issue now is "How
doe I see if a file exists from inside of Excel using VB?
A couple of ways. 1) Look at DIR loop to see if the file is present. 2)Use
Dir with a full path to the file and see what gets returned. If the file is
present it will return the file name. 3) use an error trap and one of the
file attribute functions, like GetAttr or FileDateTime.
 
D

David Langschied

Thanks! This did it!

Bob Greenblatt said:
A couple of ways. 1) Look at DIR loop to see if the file is present. 2)Use
Dir with a full path to the file and see what gets returned. If the file is
present it will return the file name. 3) use an error trap and one of the
file attribute functions, like GetAttr or FileDateTime.
 

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