Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for CreatedBy ("author") and CreatedOn
What will be the VBA code for Created by (i.e, Author)
and Created on. I Intend to use it in a class module to insert that information in my excel footer. I am using excel 2000. Please help Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for CreatedBy ("author") and CreatedOn
ActiveWorkbook.BuiltinDocumentProperties("Author")
See the VBA help for a list -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Mario" wrote in message ... What will be the VBA code for Created by (i.e, Author) and Created on. I Intend to use it in a class module to insert that information in my excel footer. I am using excel 2000. Please help Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for CreatedBy ("author") and CreatedOn
For author there is the undocumented (I believe undocumented):
? Thisworkbook.Author Thomas W. Ogilvy ? thisworkbook.BuiltinDocumentProperties("Creation Date").Value 9/22/03 7:40:20 PM -- Regards, Tom Ogilvy Ron de Bruin wrote in message ... ActiveWorkbook.BuiltinDocumentProperties("Author") See the VBA help for a list -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Mario" wrote in message ... What will be the VBA code for Created by (i.e, Author) and Created on. I Intend to use it in a class module to insert that information in my excel footer. I am using excel 2000. Please help Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for CreatedBy ("author") and CreatedOn
When I use, ActiveWorkbook.BuiltinDocumentProperties ("Creation Date").Value, it throws up some errors. But when I use on error resume next, it doesnt, for obvious reason. Is it throwing errors because the creation date is empty?. When I do the right click on the file name in windows exploer, then properties, it does have creation date. I am trying to accomplish these: 1. File Name, Path and Worksheet Name 2. Created by, Created On 3. Last Saved by, Last Saved On 4. Printed by, Printed On. Following is the piece of VBA code I used: Private Sub Workbook_BeforePrint(Cancel As Boolean) 'On Error Resume Next With ActiveSheet.PageSetup .LeftFooter = "&8" & _ LCase(ActiveWorkbook.FullName) & "; Worksheet:" & " &A " & vbLf & _ "Created by " & ActiveWorkbook.BuiltinDocumentProperties("Author") & " on " & ActiveWorkbook.BuiltinDocumentProperties("Creation Date").Value & vbLf & _ "Last Saved by " & ActiveWorkbook.BuiltinDocumentProperties("Last Author") & " on " & Format(ActiveWorkbook.BuiltinDocumentProperties ("Last Save Time"), "dddd dd mmm yyyy, hh:mm AM/PM") & vbLf & _ "Printed by " & Application.UserName & " on " & Format(Now(), "dddd dd mmm yyyy, hh:mm AM/PM") .RightFooter = "&8" & "Page &P of &N" End With 'On Error GoTo 0 End Sub All of the part is working fine except for the Create Date. Please help. Thanks -----Original Message----- For author there is the undocumented (I believe undocumented): ? Thisworkbook.Author Thomas W. Ogilvy ? thisworkbook.BuiltinDocumentProperties("Creation Date").Value 9/22/03 7:40:20 PM -- Regards, Tom Ogilvy Ron de Bruin wrote in message ... ActiveWorkbook.BuiltinDocumentProperties("Author") See the VBA help for a list -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Mario" wrote in message ... What will be the VBA code for Created by (i.e, Author) and Created on. I Intend to use it in a class module to insert that information in my excel footer. I am using excel 2000. Please help Thanks . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for CreatedBy ("author") and CreatedOn
I know Excel 97 doesn't maintain last save time, and since you have all four
references in a single command, it might be that property that is causing the problem. If you are getting an error, then it probably means the property is empty. -- Regards, Tom Ogilvy mario wrote in message ... When I use, ActiveWorkbook.BuiltinDocumentProperties ("Creation Date").Value, it throws up some errors. But when I use on error resume next, it doesnt, for obvious reason. Is it throwing errors because the creation date is empty?. When I do the right click on the file name in windows exploer, then properties, it does have creation date. I am trying to accomplish these: 1. File Name, Path and Worksheet Name 2. Created by, Created On 3. Last Saved by, Last Saved On 4. Printed by, Printed On. Following is the piece of VBA code I used: Private Sub Workbook_BeforePrint(Cancel As Boolean) 'On Error Resume Next With ActiveSheet.PageSetup .LeftFooter = "&8" & _ LCase(ActiveWorkbook.FullName) & "; Worksheet:" & " &A " & vbLf & _ "Created by " & ActiveWorkbook.BuiltinDocumentProperties("Author") & " on " & ActiveWorkbook.BuiltinDocumentProperties("Creation Date").Value & vbLf & _ "Last Saved by " & ActiveWorkbook.BuiltinDocumentProperties("Last Author") & " on " & Format(ActiveWorkbook.BuiltinDocumentProperties ("Last Save Time"), "dddd dd mmm yyyy, hh:mm AM/PM") & vbLf & _ "Printed by " & Application.UserName & " on " & Format(Now(), "dddd dd mmm yyyy, hh:mm AM/PM") .RightFooter = "&8" & "Page &P of &N" End With 'On Error GoTo 0 End Sub All of the part is working fine except for the Create Date. Please help. Thanks -----Original Message----- For author there is the undocumented (I believe undocumented): ? Thisworkbook.Author Thomas W. Ogilvy ? thisworkbook.BuiltinDocumentProperties("Creation Date").Value 9/22/03 7:40:20 PM -- Regards, Tom Ogilvy Ron de Bruin wrote in message ... ActiveWorkbook.BuiltinDocumentProperties("Author") See the VBA help for a list -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Mario" wrote in message ... What will be the VBA code for Created by (i.e, Author) and Created on. I Intend to use it in a class module to insert that information in my excel footer. I am using excel 2000. Please help Thanks . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) |