Answered by:
Dates on excel spreadsheets

Question
-
i would like to be able to track the dates and times that a spreadsheet is accessed. I realize there is a track changes option, but I would like to somehow be able to see the dates and times also. Any assistance is greatly appreciated.
- Moved by litdev Monday, August 3, 2015 7:02 PM
Wednesday, July 22, 2015 8:19 PM
Answers
-
Hello,
You should ask in the Microsoft Office Excel Community Forums.
As the Microsoft Community is on a different platform, we cannot move the question for you.Once there, click on Participate near the top of the screen, and select 'Ask a Question' or 'Start a Discussion'
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})- Proposed as answer by Mike Laughlin Wednesday, August 5, 2015 3:03 PM
- Marked as answer by Dave PatrickMVP Thursday, August 13, 2015 3:15 PM
Wednesday, August 5, 2015 3:00 PM
All replies
-
I don't think this can be found through the Small Basic language. Perhaps try to find a spreadsheet (Excel) forum?
Jan [ WhTurner ] The Netherlands
Thursday, July 23, 2015 11:39 AM -
You have different ways to get dates or other properties/details about your spreadsheet (or any kind of file(type) or folder).
But 1st: To get dates that are stored in a spreadsheet cell, means read, write edit the file itself you can use extension https://excel4smallbasic.codeplex.com/ with SB 1.0 or a recompiled version (source is available) with SB 1.1.
To get datetime information(s) about the xls file there a 3 ways depending on the specified date you need:
xls = "path\to your\spreadsheet.xls" tab = Text.GetCharacter(9) ''1. TextWindow.WriteLine("Created: " + LDFile.CreationTime(xls)) TextWindow.WriteLine("Modified: " + LDFile.ModifiedTime(xls)) TextWindow.WriteLine("Last accessed: " + LDFile.AccessTime(xls)) TextWindow.WriteLine("") '' 2. arrAllXlsDetails = LDShell.GetAllDetailsFor(xls) ' as "detail name=detail value;..;" arrAllXlsDetNames = Array.GetAllIndices(arrAllXlsDetails) 'get all available detail names For n = 1 To Array.GetItemCount(arrAllXlsDetails) TextWindow.WriteLine(arrAllXlsDetNames[n] +tab+ arrAllXlsDetails[arrAllXlsDetNames[n]]) EndFor TextWindow.WriteLine("") ''3. '' The value for a single extended detail eg. "Date accessed" (Index#=5 on Win7/Win8) accW78 = LDShell.GetDetail(xls, 5) ' same # on W7 and W8 in this case accEn = LDShell.GetDetail(xls, "Date accessed") ' on ENGLISH W7 and W8 TextWindow.WriteLine("Last accessed: " +tab+ accW78) TextWindow.WriteLine("Last accessed: " +tab+ accEn) TextWindow.WriteLine("")
Where:
1. This are the common known main dates fom the 'General' PropertiesTab, via LDFile
2. This are 1. and additionally dates/details from the 'Details' PropertiesTab (resp. colums from details view in explorer) for xls file type resp. available for that special xls file (via LDShell)
among other details there may be also available: "Content created", "Last printed", "Date last saved", ... for a certain xls file.
arrAllXlsDetails = LDShell.GetAllDetailsFor(xls) ' returns all available detail- names and -values for a given file. These details differ from file(type) to file(type). So of course an mp3 file has different available details than a doc, zip or lnk. But that's clear.
You can isolate the needed date from this array like:
dt = arrAllXlsDetails["Date last saved"] ' on an ENGLISH OS for here "Date last saved".
3. To get a single detail by it's detailname or -index# you can use LDShell.GetDetail
eg. lets say, you want the "Date last saved" detail for your spreadsheet:
dt = LDShell.GetDetail(xls, "Date last saved") ' by detail name only on an ENGLISH OS ....
(dt = LDShell.GetDetail(xls, "Letzte Speicherung") ' .... would be the same on a german OS)
or
dt = LDShell.GetDetail(xls, 145) ' .... same via Index# on Win7, any OS lang.
dt = LDShell.GetDetail(xls, 146) ' ... same via Index# on Win8, any OS lang.
PS: All available index numbers and detail names for all file types and for your OS and OS langage you can get by:
allDets = LDShell.AllDetails
TextWindow.WriteLine(allDets)as array.
I know, that's a lil complicated esp. for beginners. To give you a ready and working sample for your spreadsheet, your OS version and OS language would be helpfull, as well as the exact date type you want (like from: Date modified, Date created, Date accessed, Content created, Last printed, Date last saved, ... perhaps additional datetimes are available for a certain xls)
- Edited by Pappa Lapub Friday, July 24, 2015 3:52 PM
Friday, July 24, 2015 2:57 PM -
Hello,
You should ask in the Microsoft Office Excel Community Forums.
As the Microsoft Community is on a different platform, we cannot move the question for you.Once there, click on Participate near the top of the screen, and select 'Ask a Question' or 'Start a Discussion'
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})- Proposed as answer by Mike Laughlin Wednesday, August 5, 2015 3:03 PM
- Marked as answer by Dave PatrickMVP Thursday, August 13, 2015 3:15 PM
Wednesday, August 5, 2015 3:00 PM