I have an excel macro that is intended to save a subset of data to a report under a unique, yet deliberate file name. Here's an excerpt:
[VBA]' Creates a temporary base file name.
Const FILE_NAME As String = _
"S:\Open Provisioning Reports\0903 2009 Open Provisioning - Pkg.xls"
ActiveWorkbook.SaveAs _
Filename:=Replace(FILE_NAME, "<date>", Format(Date, "yymm")), _
FileFormat:=xlNormal
ActiveWindow.Close
[/VBA]
In the code above this, I declared a variable (string) named IB that contains the value of the year -- 2009 in the example above.
I save a new copy of this file at the beginning of each new month, so ideally I'd like the macro to look at the current system date and express that as yymm -- 0903 in the example above.
The code I've got isn't cutting it -- any pointers?