Questions tagged [office-scripts]

Office Scripts is a feature that allows you to automate tasks in Microsoft Office using TypeScript. Currently, this feature is only supported in Excel. Use this tag to ask programming questions about Office Scripts, and consider adding the related tags Excel and TypeScript where relevant.

Office Scripts is a feature that allows you to automate tasks in Microsoft Office using TypeScript.

Currently, this feature is only supported in Excel.

Office Scripts can be created either by using a macro recorder, or by manually writing the script.

Office Scripts contrast themselves from VBA by being usable in Office Online, being primarily asynchronous (while VBA is nearly always synchronous), and lacking support for events. Office Scripts also cannot work with local files and programs.

The documentation is available here: https://learn.microsoft.com/en-us/office/dev/scripts/

Office Scripts use a subset of the Excel JavaScript API, the documentation for that can be found here: https://learn.microsoft.com/en-us/office/dev/add-ins/reference/overview/excel-add-ins-reference-overview

314 questions
0
votes
2 answers

Excel Script run from Power Automate failing with error 504

I am using PowerAutomate to add data to a report each day. The data comes in on email as a CSV attachment, this is parsed with an Azure function into a 2D array and stringified to JSON, this is then passed to an excel script that parses the JSON,…
0
votes
3 answers

How to enable new synchronous Excel Javascript API?

This article says a new simplified Office API is in "Preview" mode. Who gets to preview it? When will it come out of Preview (been almost a year)? Will it be available in Excel online? Is a special license required? I'm using the free Excel…
johny why
  • 2,047
  • 7
  • 27
  • 52
0
votes
1 answer

Count spaces in NumberFormat with ExcelScript using OfficeScripts in Excel for Web

I have to count the spaces within in NumberFormat of each cell in column A. Here is an example NumberFormat: " "@ I translated my VBA code into OfficeScripts ExcelScript (for Excel for Web) but it seems that the replace…
0
votes
1 answer

addChart not working how "Record Actions" recorded it

I used the "Record Actions" in the Automate tab to record myself creating a chart. The Chart looks exactly how I want it to look after recording. function main(workbook: ExcelScript.Workbook) { let selectedSheet = workbook.getActiveWorksheet(); …
Ethan
  • 808
  • 3
  • 21
0
votes
2 answers

Interface error on Office Script (Excel on Web)

I am trying to call an external API (https://api.fortnox.se/3/customers/2) from an Excel on web. The Web API I am calling returns a jason data structure such as the "Response" under "Retrieve a customer" session here:…
Max
  • 1
  • 1
0
votes
1 answer

How to update the source data range for existing chart

I'm trying to write a script that finds data in a sheet dynamically (the dimensions of the table need to be flexible in both axis) and then updates the source data range for an existing chart on another sheet (so that my users don't need to set up…
Mookmac
  • 11
  • 3
0
votes
1 answer

ExcelScript (Online): Get current file name

I'm trying to automate with Office-Scripts and Microsoft Power Automate (former Flow) some process. I simply try to get the current file name of each excel file, but I am failing the whole time. How do I get the current filename? function…
0
votes
1 answer

Office Scripts Daily Call Limitation

In this link it says that when using Office Scripts with Power Automate, you're limited to 200 calls per day and that the limit resets at 12:00AM UTC. If I shared my Power Automate scheduled flow with someone and it is now under the "Shared with me"…
Ethan
  • 808
  • 3
  • 21
0
votes
0 answers

Remove ActiveX controls automatically via Power Automate?

I have a process that requires me to take an Excel file that has ActiveX controls in it, and upload it into a database. I am trying to automate this in a flow by uploading the file to OneDrive, and then manipulating the document and extracting the…
Ethan
  • 808
  • 3
  • 21
0
votes
2 answers

Excel Online: Add timestamp when cell changes in the same row

I've been searching high and low for a solution to this but I've only found lots of answers for Google Apps instead of Excel Online. Not sure if the Google Apps script can be used in Excel Online, but here goes anyway. What I'm looking for is…
0
votes
1 answer

How to insert a parameter in

I need to insert a parameter into this: row: workbook.getWorksheet("VittorioZigiotto").getRange("VittorioZigiotto[237]:Vittorioigiotto[241]") The parameter need to be where now there is "237" and neet to depend on a cell in the workbook. For…
riky
  • 3
  • 2
0
votes
1 answer

Office Script Loop Excel Automate

Quick question I have around loops for office script in excel I want to loop the below code/formatting changes across specific worksheets. I want to be able to select the sheets based on the worksheet name eg. Worksheet name starts with "XYZ",…
Kureelpa_Rat
  • 11
  • 1
  • 5
0
votes
1 answer

Is there a way to return the "Body" of an Outlook email as a string and not HTML using Office Script?

I want to extend the "Pass data to scripts in an automatically-run Power Automate flow (preview)" tutorial to include the Body parameter of an email. function main( workbook: ExcelScript.Workbook, from: string, dateReceived: string, subject:…
Zach
  • 1
0
votes
1 answer

How to do a GET request using fetch API with OfficeScripts (TypeScript). Getting no response

I tried to run this function in excel online and seem to get an error on fetch. I've tried other variations and at times I get no errors but no response text. I'm new to typescript but I've successfully done the same/similar GET requests in Python…
0
votes
1 answer

Office Scripts in Power Automate - Sharing Scripts but not via Workbook

In using Office Scripts in Power Automate, how can i share the scripts with other team members so when they run a flow, I dont have to share within a workbook. I don't want standard users accessing the workbook and having visibility of the…
ATTREWS
  • 9
  • 1
1 2 3
20
21