Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,102 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Good morning,
I have an excel script that filters a table and copies the visible part of the table to another sheet. The starting table is a list of error messages collected from a system on a daily basis and therefore varies in number of rows every day.
Some days, the script fails on the copy function with the indication that the variable which contains the list of cell addresses to copy is not in the correct format.
The code is as follows:
// Setting a filter
TableImportJson.getColumnByName("Error_message").getFilter().applyCustomFilter("=*CfgData*", "=*CfgPrice*", ExcelScript.FilterOperator.or);
// Copy the visible lines in the table to another sheet
const visibleTableRange: ExcelScript.RangeView = TableImportJson.getRange().getVisibleView();
const source = ImportJSON.getRanges(visibleTableRange.getCellAddresses().toString()); DataErrorsSheet.getRange("A1").copyFrom(source, ExcelScript.RangeCopyType.all);
Attached is the content of 'source' from a run of the script which failed.
Thank you for your help.