close

I have wrongly used the quot;NOWquot;- term to set the date in my documents which
means that every time I open and save the document the date is changed. (The
problem is solved regarding all documents created from now and onwards). Any
suggestions how to make a quot;globalquot; macro or function which can pick up the
Creation Date and replace the quot;NOWquot;-term with the creation date in all those
documents that has been datechanged cause I have opened them after the
creation date?
Thanks on forehand
Kjell

Kjell

You can get the creation date of the activeworkbook with code like this

Sub GetCreateDate()
If InStr(1, ActiveWorkbook.FullName, quot;\quot;) = 0 Then
MsgBox quot;You must save the workbook firstquot;
Exit Sub
End If
ActiveCell.Value = ActiveWorkbook.BuiltinDocumentProperties(quot;Creation Datequot;)
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HISquot;Kjell Forssenquot; lt;Kjell gt; wrote in message
...
gt;I have wrongly used the quot;NOWquot;- term to set the date in my documents which
gt; means that every time I open and save the document the date is changed.
gt; (The
gt; problem is solved regarding all documents created from now and onwards).
gt; Any
gt; suggestions how to make a quot;globalquot; macro or function which can pick up
gt; the
gt; Creation Date and replace the quot;NOWquot;-term with the creation date in all
gt; those
gt; documents that has been datechanged cause I have opened them after the
gt; creation date?
gt; Thanks on forehand
gt; Kjell
Nick
Thank you for your extremly good help. I could never have solved it myself
and I just copied the cod into a makro and it works just great!

Yours for ever gratefull user!

Regards
Kjellquot;Nick Hodgequot; skrev:

gt; Kjell
gt;
gt; You can get the creation date of the activeworkbook with code like this
gt;
gt; Sub GetCreateDate()
gt; If InStr(1, ActiveWorkbook.FullName, quot;\quot;) = 0 Then
gt; MsgBox quot;You must save the workbook firstquot;
gt; Exit Sub
gt; End If
gt; ActiveCell.Value = ActiveWorkbook.BuiltinDocumentProperties(quot;Creation Datequot;)
gt; End Sub
gt;
gt; --
gt; HTH
gt; Nick Hodge
gt; Microsoft MVP - Excel
gt; Southampton, England
gt; www.nickhodge.co.uk
gt; HIS
gt;
gt;
gt; quot;Kjell Forssenquot; lt;Kjell gt; wrote in message
gt; ...
gt; gt;I have wrongly used the quot;NOWquot;- term to set the date in my documents which
gt; gt; means that every time I open and save the document the date is changed.
gt; gt; (The
gt; gt; problem is solved regarding all documents created from now and onwards).
gt; gt; Any
gt; gt; suggestions how to make a quot;globalquot; macro or function which can pick up
gt; gt; the
gt; gt; Creation Date and replace the quot;NOWquot;-term with the creation date in all
gt; gt; those
gt; gt; documents that has been datechanged cause I have opened them after the
gt; gt; creation date?
gt; gt; Thanks on forehand
gt; gt; Kjell
gt;
gt;
gt;

Hi again!
I am still very pleased with your solution to my problem but I was a little
bit to entuthiastic. I placed the macro in a workbook called own.xls wich
starts automaticly every time I open one of my (faulty) documents. This
workbook are storing all other macros that are used when creating the
documents. It seems like if the macro takes the date from the own.xls and
put as create date (which is quit logic). How can I get it to go to the other
opened workbook and take the create date from that workbook and place into
the cell. Can I place the macro somewhere outside of the opened documents and
run it when I am standing in a faulty document without having to copy the
macro into that specifik document?

Regards
Kjell

quot;Nick Hodgequot; skrev:

gt; Kjell
gt;
gt; You can get the creation date of the activeworkbook with code like this
gt;
gt; Sub GetCreateDate()
gt; If InStr(1, ActiveWorkbook.FullName, quot;\quot;) = 0 Then
gt; MsgBox quot;You must save the workbook firstquot;
gt; Exit Sub
gt; End If
gt; ActiveCell.Value = ActiveWorkbook.BuiltinDocumentProperties(quot;Creation Datequot;)
gt; End Sub
gt;
gt; --
gt; HTH
gt; Nick Hodge
gt; Microsoft MVP - Excel
gt; Southampton, England
gt; www.nickhodge.co.uk
gt; HIS
gt;
gt;
gt; quot;Kjell Forssenquot; lt;Kjell gt; wrote in message
gt; ...
gt; gt;I have wrongly used the quot;NOWquot;- term to set the date in my documents which
gt; gt; means that every time I open and save the document the date is changed.
gt; gt; (The
gt; gt; problem is solved regarding all documents created from now and onwards).
gt; gt; Any
gt; gt; suggestions how to make a quot;globalquot; macro or function which can pick up
gt; gt; the
gt; gt; Creation Date and replace the quot;NOWquot;-term with the creation date in all
gt; gt; those
gt; gt; documents that has been datechanged cause I have opened them after the
gt; gt; creation date?
gt; gt; Thanks on forehand
gt; gt; Kjell
gt;
gt;
gt;

Hi again!
I have been checking for the source of the date and it is not from the
workbook Own.xls(equals to personal.xls in the english version). It must be
generated of the template (*.xlt) since the date is the same whenever the
document was named and saved. In the Properties wiew under Archive there is
no date set to the Creat date on the template - it just says (unknown).
Regards
Kjell

quot;Kjell Forssenquot; skrev:

gt; I have wrongly used the quot;NOWquot;- term to set the date in my documents which
gt; means that every time I open and save the document the date is changed. (The
gt; problem is solved regarding all documents created from now and onwards). Any
gt; suggestions how to make a quot;globalquot; macro or function which can pick up the
gt; Creation Date and replace the quot;NOWquot;-term with the creation date in all those
gt; documents that has been datechanged cause I have opened them after the
gt; creation date?
gt; Thanks on forehand
gt; Kjell

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()