I have an excel sheet stored on Sharepoint and I want to fill in info into a certain cell for example C5 = value of script
How can we do this?
I was able to do what I wanted with update rows instead. I didn't understand it before but I found something that was helpful. Thank you!
Please take a look at these tutorials.
You need to create an Office Script and then use the Office Script here. Hardcoded scripts here are not supported.
I keep getting this:
Here's what I put down as my script:
The following script will do what you want.
function main(workbook: ExcelScript.Workbook) {
// Standard javascript date object operations to get the name of the previous month
// I searched on google: 'js get previous month', found this site https://reactgo.com/javascript-get-previous-month-name/ and shamelessly repurposed it for the following
const current = new Date();
current.setMonth(current.getMonth() - 1);
const previousMonth = current.toLocaleString('default', { month: 'long' });
// Set 'previousMonth' as the value in some range in some worksheet
workbook.getWorksheet("Sheet5").getRange("A1").setValue(previousMonth);
}
Output:
Hello @GeoffRen;
I think you can help me with my problem, i have an excel file that i duplicate evrey month, then i have to update a cell with the value of the first day of the last month. I tried to do this with the action "Update a row" in power automate, but it take more than 6min to update one cell. do you know others way fater to update a cell, maybe with the excel scripts ?
thanks in advance for your response
Keep in mind that if you want to do this without using tables, you will have to use Office Scripts (specifically Office Scripts with Power Automate)? This is the 'Run Script' action on the Excel connector. With Office Scripts you can use the 'Run Script' action to execute javascript against a workbook. So, in your case, you would have a script that just assigns the value of a cell a parameter. So something like
Hi @aralvesbe
With update a row you can select the column and value as a reference and then update any of the columns within that row.
This would update row 3, Dave to New Value
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien