Forum Discussion

Markku_E's avatar
Markku_E
Copper Contributor
Jan 09, 2025

Can the Excel column width be set to fixed

Can the Excel column width be set to fixed so that the width does not change during an ODBC update?

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    Excel column width can be set to a fixed value to prevent it from changing during an ODBC update or other operations. This behavior typically occurs when Excel tries to auto-adjust the column width based on the updated data. To ensure the column width remains fixed, follow these steps:

    1. Set the Column Width to a Fixed Value

    • Select the column(s) you want to fix the width for.
    • Right-click on the selected column header and choose Column Width.
    • Enter a specific numeric value for the width (e.g., 15) and click OK.

    2. Disable Auto-Resizing (If Necessary)

    If the column width changes during an ODBC update, it's usually because Excel has a setting to auto-fit the columns based on the new data. You can prevent this by:

    • Selecting the column(s).
    • Right-clicking and choosing Format Cells.
    • On the Protection tab, ensure the "Locked" checkbox is enabled (you’ll need to protect the sheet to enforce this).
    • Protect the worksheet via the Review tab → Protect Sheet, ensuring that formatting options like "Format Columns" are disabled.

    3. Prevent Changes During ODBC Updates

    • Ensure your ODBC query or data connection is not configured to auto-format. You can check this by:
      • Going to the Data tab.
      • Clicking on Properties for your data connection.
      • In the dialog box, uncheck Adjust column width and Preserve cell formatting options.
      • Click OK to save the settings.

    By following these steps, you can ensure that the column width remains fixed even when new data is loaded or updated via an ODBC connection. The info’s are from AI, backup your file before you follow the steps.

     

    Hope this will help you.

Resources