A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
When I record a column width change script, I get code with getFormat(), like:
selectedSheet.getRange("C:E").getFormat().setColumnWidth(10);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm getting errors when trying to set column widths within an excel script. I keep getting hit with "Property 'setColumnWidth' does not exist on type 'Range'."
What is correct to use? I'm not sure what I'm doing wrong here. I've seen that others have had similar issues, and copilot is telling me this should work as well.
selectedSheet.getRange("C:E").setColumnWidth(10);
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
When I record a column width change script, I get code with getFormat(), like:
selectedSheet.getRange("C:E").getFormat().setColumnWidth(10);