I am trying to reference another file from my blank script file. I just want to use the script to clear filters using this method via power automate. I do not want power query or other methods.
The typescript here will only look the current opened excel, how can I run this for another file? The reason I cannot put this code in my target file is due to restrictions. so I am making a copy of the file via power automate , then want to run a script to clear filters.
function main(workbook: ExcelScript.Workbook) {
let selectedSheet= workbook.getWorksheet("Draft");
selectedSheet.getAutoFilter()
.clearCriteria
selectedSheet.getAutoFilter()
.remove
}
any help is appreciated.