Bug 167216 - Calc. AutoFit does not work if Application.ScreenUpdating is False
Summary: Calc. AutoFit does not work if Application.ScreenUpdating is False
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: x86-64 (AMD64) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2025-06-25 19:34 UTC by lumentulo
Modified: 2026-03-12 15:22 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lumentulo 2025-06-25 19:34:21 UTC
Description:
Good day to you.

AutoFit method does not work if Application.ScreenUpdating set to False. Tested on 6.3, 7.5, 24.2, and 25.2.4.3.

You can just set some long enough string to Cell "A1" and check it.

```basic
Option VBASupport 1

Public Sub VBAMain()

    Application.ScreenUpdating = False
    Rows(1).AutoFit
    Application.ScreenUpdating = True

End Sub
```

Moreover, if I forget to set Application.ScreenUpdating to True then I'm not able to autofit even using interface, double-clicking on a bottom border of a row.

Actual Results:
No results

Expected Results:
Actual row height autofit


Reproducible: Always


User Profile Reset: No

Additional Info:
It's either I don't know how to write it correctly in LibreOffice Basic, or ThisComponent.LockController works perfectly.
Comment 1 Buovjaga 2026-03-11 16:10:51 UTC
Testing this in 26.2 and later is affected by bug 169110. It causes this:
BASIC runtime error.
'423'
Property or method not found: ScreenUpdating.

I reproduce the main issue already in oldest of Windows 4.3 bibisect repo.
Comment 2 Devansh Varshney 2026-03-12 15:09:03 UTC
This looks interesting since this bug was filed before the Object Browser 
work was merged, yet it now follows the same failure path as the
VBAGlobals/CutCopyMode regression.

The raw-source reading solution is relevant for bug 169110.

However, the `Application.ScreenUpdating = False`/ `AutoFit` behavior here 
likely represents a separate issue in the Calc VBA implementation rather 
than being caused by the Object Browser regression.
Comment 3 Buovjaga 2026-03-12 15:22:06 UTC
(In reply to Devansh Varshney from comment #2)
> This looks interesting since this bug was filed before the Object Browser 
> work was merged, yet it now follows the same failure path as the
> VBAGlobals/CutCopyMode regression.
> 
> The raw-source reading solution is relevant for bug 169110.
> 
> However, the `Application.ScreenUpdating = False`/ `AutoFit` behavior here 
> likely represents a separate issue in the Calc VBA implementation rather 
> than being caused by the Object Browser regression.

Sure, my comment in this report was just a heads up, so others don't wonder.