I need to automate a simple pipeline which runs the Excel Solver. I'd like to use Office Scripts (TypeScript https://learn.microsoft.com/en-us/javascript/api/office-scripts/overview?view=office-scripts). I've written a VBA script which works, but would rather use Office Script because it is a more robust language, and can be more easily integrated into cloud-based pipelines.
Example VBA script:
' Initialize inputs
Range("$A$1:$A$3").Value = 0
' Run solver
SolverSolve
Desired Office Scripts
function main(workbook: ExcelScript.Workbook) {
// Initialize inputs
let currentWorksheet = workbook.getActiveWorksheet();
currentWorksheet.getRange("$H$16:$H$24").setValue(0);
// Run solver
<<Insert Office Script code here>>
}
I don't see the Solver in the ExcelScript API https://learn.microsoft.com/en-us/javascript/api/office-scripts/excelscript?view=office-scripts. Am I missing something, or is there any other way to get the Solver to run using Office Script?