Automatic Date Stamping


R

Risky Dave

Hi,

I have a macro that works out of an XL file which populates a Word template
with charts.

The macro then saves the template with a new name, using:

With WDDoc
.SaveAs ("C:\MyReport.doc")
End With

Is it possible to save the file with a custom date stamp (yyddmm) so that
the file would be called something like "080404 MyReport.doc"

I can then run the report the next day to produce 080405 MyReport.doc and so
on.

TIA

Dave
 
Ad

Advertisements

I

Ivyleaf

Hi,

I have a macro that works out of an XL file which populates a Word template
with charts.

The macro then saves the template with a new name, using:

With WDDoc
        .SaveAs ("C:\MyReport.doc")
    End With

Is it possible to save the file with a custom date stamp (yyddmm) so that
the file would be called something like "080404 MyReport.doc"

I can then run the report the next day to produce 080405 MyReport.doc and so
on.

TIA

Dave

Hi Dave,

You almost answered your own question! Just change

.SaveAs ("C:\MyReport.doc")

to

.SaveAs ("C:\" & Format(Date(),"yyddmm") & " MyReport.doc")

Cheers,
Ivan.
 

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