rename file macro

D

dtroupe

I am exporting from Access to Excel by using a macro in
Access. Access overwrites the file unless you change the
name of the worksheet the export created in which case it
will create a second worksheet. I can either keep renaming
the worksheet after it is created, (which needs to be
automated without opening the worksheet manually), or I
can just run some kind of auto macro that will look for a
sheet named export.xls at some time in the morning after
the other macro has created the file and name it to the
machine date, i.e. 12032003.xls ? If I can do the later
then I can force the macro in Access to run at 00:10 in
the morning by a Windows Scheduler I am using and then
have that scheduler open this Excel file and close it
after renaming the export.xls file (if it exists). This
way I can enjoy my weekends?
 
T

Tom Ogilvy

You can't rename it using the macro in Access?

Look at the VBA Name function .

Name "c:\abcd\export.xls" as "c:\abcd\" & format(date,"yyyymmdd") & ".xls"
 

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