logo
search
list

Table of Content

Problem Description: Setcolumnwidth Broken Excel Scripts
Quick Answer for VBA Quick Fix
Likely Causes Behind Excel Failure Patterns
Recommended Solution: Fixing VBA Step by Step
Alternative Solutions for Fallback Options for VBA
Working with WPS Office: Editing Files in WPS During VBA
Prevention Tips for Smooth Excel Device Transfers
FAQs About VBA Help Topics

Is Excel Having Setcolumnwidth Broken Excel Problems? Here Is the Fix

Posted by Algirdas Jasaitis

calendar

2026-09-09

views

868

likes

59

If your workflow is blocked, confirm the account and app context, then follow the ordered fixes below.

Problem Description: Setcolumnwidth Broken Excel Scripts

I have written a very simple code in Office Scripts which should simply set some column widths and the header rows (see below). However, when I run the script, the column widths are nowhere near the values I have input (I have added comments to show the column widths which get set when the script is run). Is this a general issue with .setColumnWidth() or have I missed something? ```typescript function main(workbook: ExcelScript.Workbook) { let sheets = workbook.getWorksheets(); sheets.forEach(sheet => { sheet.getRange("E:G").getFormat().setColumnWidth(14.00); //becomes 2.00 (19px) sheet.getRange("H:I").getFormat().autofitColumns; sheet.getRange("J:J").getFormat().setColumnWidth(25.00); //becomes 4.00 (33px) sheet.getRange("L:L").getFormat().setColumnWidth(16.43); //becomes 2.43 (22px) sheet.getRange("S:S").getFormat().setColumnWidth(11.43); //becomes 1.43 (15px) sheet.getRange("U:U").getFormat().setColumnWidth(19.29); //becomes 3.00 (26px) sheet.getRange("1:1").getFormat().autofitRows(); }) } ```

Quick Answer for VBA Quick Fix

setColumnWidth() has been confirmed to incorrectly set column widths, and this issue is being investigated internally (tracking #9333095).

Likely Causes Behind Excel Failure Patterns

  • The Microsoft account or license context may not match the purchase or device.

  • Cached credentials, outdated builds, or damaged local components can trigger vba & macro problems.

  • A file-specific corruption or add-in conflict can mimic a broader application failure.

Recommended Solution: Fixing VBA Step by Step

When to use this: Apply these steps when the symptoms match and you can access the relevant Microsoft account or administrator.

  1. As a workaround, try using different values in the API until you achieve the desired column width.

  2. Follow up for updates once more information is available from the investigation team.

Free Office Download
   
  • Use Word, Excel, and PPT for FREE, No Ads.

  • Edit PDF files with the powerful PDF toolkit.

  • Microsoft-like interface. Easy to learn. 100% Compatibility.

  • Boost your productivity with WPS's abundant free Word, Excel, PPT, and CV templates.

100% secure
avator
Algirdas Jasaitis

Alternative Solutions for Fallback Options for VBA

  1. Retry the Microsoft-side steps after restarting the app and device.

  2. Test the same action in a private browser session or a new blank file to isolate account vs file issues.

  3. Capture exact error text and screenshots before contacting Microsoft Support or your administrator.

Working with WPS Office: Editing Files in WPS During VBA

WPS Office free suite for documents spreadsheets presentations and PDFs
WPS Office — free office suite for documents, spreadsheets, presentations, and PDFs.

WPS Office cannot replace Microsoft account, activation, or cloud fixes for this scenario. It remains one of the best free Microsoft Office-compatible alternatives for opening and editing local files.

  1. Download and install WPS Office from the official website.

  2. Open local Word, Excel, PowerPoint, or PDF files in the matching WPS app.

  3. Save a working copy locally while Microsoft-side issues are resolved.

  4. Return to Microsoft Office after the primary fix succeeds.

If you need a practical local workspace in the meantime, try WPS Office.

100% secure

Prevention Tips for Smooth Excel Device Transfers

  • Keep one primary Microsoft account for subscriptions and Office sign-in.

  • Install updates for Office and Windows before retrying failed workflows.

  • Back up important files before repair, reset, or reinstall actions.

  • Document exact error messages before the next troubleshooting attempt.

FAQs About VBA Help Topics

Can WPS Office fix this vba & macro problems issue directly? Only when the WPS steps match the formatting or file task. Account, activation, and cloud issues stay on the Microsoft side.

Should I reinstall Excel before trying these steps? Not first. Confirm account, license, and the exact error before reinstalling.

What should I send to Microsoft Support? The affected account email, device type, Office version, exact error text, and screenshots with personal data hidden.

Algirdas Jasaitis

15 years of office industry experience, tech lover and copywriter. Follow me for product reviews, comparisons, and recommendations for new apps and software.