Site feedback

WatsonNathan-6052 avatar image
0 Votes"
WatsonNathan-6052 suggested natewatson-7308 published

Trying to use CreationDate of comments (timestamping)

I am trying to run a script that if a comment is made in column K, it then would timestamp the creation of that comment in column L.

"ExcelScript.Comment" interface makes it look like this is possible with "getCreationDate()" and "getLocation()". but with the initial function "main(workbook: ExcelScript.Workbook)" it doesn't want to work and for the life of me I cannot figure this out. Ultimately I am trying to get a timestamp in the L cell next to/whenever a comment is made in a K cell.

once the script works once it runs I was going to have it run in Power automate cause it doesnt matter instantly when the comment is made as long as when the script runs it kicks back "getCreationDate().

office-scripts-excel-dev
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @WatsonNathan-6052 ,

Do you mind sharing your script? This sample script worked for me to get the creation time of the first comment in my workbook:

function main(workbook: ExcelScript.Workbook) {
  const comments = workbook.getComments();
  console.log(comments[0].getCreationDate());
}
1 Vote 1 ·

Awesome thank you, I was glitching out how to pull those other excel scripts and that's the missing piece :)

1 Vote 1 ·

Awesome thank you, I was glitching out how to pull those other excel scripts and that's the missing piece :)

0 Votes 0 ·

No Solutions

Your Opinion Counts

Share your feedback, or help out by voting for other people's feedback.