Insert date automatically
You created the file in xl97 and it has never been used in a later version?
Try it in a new file. I had no problem raising the error.
--
Regards,
Tom Ogilvy
"Sean Connolly" wrote in message
...
Hi Tom,
Of course you're correct, this collection hasn't been available in Excel
'forever', but ...
On an old PC of mine I have Excel 97 SR-1 (exactly for testing such
situations <g!) and the code works just fine and dandy.
I'm intrigued now ...
Cheers, Sean.
"Tom Ogilvy" wrote:
Not to detract from your excellent advice, but just to add:
All Excel workbooks are saved with a datetimestamp as standard built-in
Excel functionality.
Isn't totally correct. This was not supported in Excel until xl2000.
For
example, in a workbook that has only been opened in Excel 97 or earlier
and
if executed in xl97, your code produces an error.
--
Regards,
Tom Ogilvy
"Sean Connolly" wrote in
message
...
Hi Mike,
All Excel workbooks are saved with a datetimestamp as standard
built-in
Excel functionality. To access this programatically (via VBA), check
out
the
BuiltinDocumentProperties collection of the Workbook object in Excel's
help.
A number of properties are available, the one you're probably most
interested
in is "Last Save Time". As an example, with a previously saved
workbook
open,
paste and execute this code into the Immediate pane of the Visual
Basic
Editor (VBE).
debug.Print ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
Hit enter and you'll get the date and time this workbook was last
saved.
e.g. 01-Jul-05 19:06:12
You can use the properties in this collection to (programatically) set
cell
values, or page headers/footers (or whatever).
HTH, Sean.
"MikeA" wrote:
Tim
Say at the bottom of the page - either side.
The idea is that a spread sheet will not be saved without a date
stamp.
Mike A
"Tim Williams" <saxifrax@pacbell*dot*net wrote in message
...
Inserted where?
Tim
"MikeA" wrote in message
...
It is probably elementary but I am no expert:
Is it possible to set up Excel in such a way that the date (and
time) will
always be inserted on Save?
Thanks
MikeA
|