Skip to content

Regression in 34.0.0-rc1: Excel .xlsm files fail during save and Excel remains unable to save until restart #10439

Description

@domingocalvente

⚠️ Before submitting, please verify the following: ⚠️

Bug description

After upgrading the Nextcloud Desktop Client to 34.0.0-rc1, Microsoft Excel intermittently fails when saving large macro-enabled .xlsm files located inside a Nextcloud synchronized folder.
The exact same files and workflow worked correctly with the previous Nextcloud Desktop Client version.
The problem is reproducible only while the Nextcloud Desktop Client is running.
Once the failure occurs, the currently running Excel process becomes unable to correctly save the workbook again, even after synchronization is paused or the Nextcloud Desktop Client is completely terminated.
Excel must be completely closed and restarted.
This appears to be a regression introduced in Nextcloud Desktop 34.0.0-rc1.

Environment

Operating system:
Windows 10 Pro 20H2
OS Build: 19042.631
64-bit operating system
Microsoft Excel:
Microsoft Excel for Microsoft 365 MSO
Version 2402
Build 16.0.17328.20124
32-bit
Nextcloud Desktop Client:
34.0.0-rc1
Windows
Update channel displayed in the client: stable
File:
Macro-enabled Microsoft Excel workbook (.xlsm)
Contains VBA macros
Relatively large workbook
Automatic VBA save operations are used
Example path:
C:\Nextcloud\Solarenergy\Presupuestos\copia borrador.xlsm

Reproduction

  1. Start Nextcloud Desktop Client 34.0.0-rc1.
  2. Open a large .xlsm workbook located inside the Nextcloud synchronized directory.
  3. Work normally with the workbook.
  4. Excel performs either an automatic VBA save or a manual save.
  5. After some save operations, Excel fails to correctly save the workbook.
  6. Subsequent save attempts start generating additional Excel/VBA errors.
  7. Pause Nextcloud synchronization.
  8. Try to save again.
  9. The Excel session does not recover.
  10. Completely terminate the Nextcloud Desktop Client.
  11. Try to save again.
  12. Excel still does not recover.
  13. Completely close Microsoft Excel.
  14. Restart Excel.
  15. The workbook works normally again until the problem is triggered again.

Control tests

I performed two important control tests.

Test A - Nextcloud completely terminated before opening Excel

Nextcloud Desktop Client was completely terminated before Excel was opened.
The same .xlsm workbook was then opened from the same physical Nextcloud directory and repeatedly saved.
Result:
No errors.

Test B - Same workbook outside the Nextcloud directory

The exact same workbook was copied to a normal local Windows directory outside Nextcloud.
The workbook was repeatedly opened and saved.
Result:
No errors.

Previous Nextcloud version

The same Excel workbook, VBA code, Windows installation and Excel installation worked correctly with the previous Nextcloud Desktop Client version.
The problem started after upgrading to Nextcloud Desktop 34.0.0-rc1.

Error sequence

After the problem is triggered, Excel starts producing several errors.
First Excel reports that VBA project features cannot be saved in a macro-free workbook, even though the workbook being used is an .xlsm file.
Excel then produces VBA Runtime Error 1004:
"No se puede usar esta extensión con el tipo de archivo seleccionado."
("The file extension cannot be used with the selected file type.")
Excel subsequently reports:
"Errors were detected while saving
C:\Nextcloud\Solarenergy\Presupuestos\copia borrador.xlsm"
Finally Excel reports:
"The document was not saved."
Screenshots of all these errors are available.

Expected behaviour

Nextcloud should monitor and synchronize the file without interfering with Excel's save procedure.
Excel should be allowed to complete its temporary-file/write/rename/replace sequence before Nextcloud processes the resulting file.

Actual behaviour

While Nextcloud Desktop 34.0.0-rc1 is running, an Excel save operation occasionally fails.
After the first failure, Excel appears to lose the correct internal relationship between the .xlsm filename and workbook format.
The Excel process then remains in an invalid state and cannot correctly save the workbook again until Excel itself is restarted.
Stopping Nextcloud after the initial failure does not recover the affected Excel process.

Suspected cause

This looks like a filesystem race condition or file-handle interaction between the Nextcloud Desktop Client and Microsoft Excel's save procedure.
Excel performs several filesystem operations during workbook saving, including temporary file creation, writing, renaming and replacement of the original workbook.
Nextcloud 34.0.0-rc1 appears to react to filesystem modifications considerably faster than the previous client version.
It is possible that the synchronization engine accesses one of the temporary or destination files while Excel is still completing the save/rename/replace sequence.
The initial problem appears to be caused by this interaction.
There may also be a secondary Microsoft Excel bug because, after the initial failed operation, Excel does not correctly recover its internal workbook state.

Why this appears to be a Nextcloud regression

The issue does not occur:

  • when Nextcloud is terminated before opening Excel;
  • when the same workbook is used outside the Nextcloud directory;
  • with the previous Nextcloud Desktop Client version.
    It started after installing Nextcloud Desktop 34.0.0-rc1.

Impact

This can potentially result in:

  • failed workbook saves;
  • lost changes;
  • VBA automation failures;
  • workbook corruption;
  • users believing that a workbook was successfully saved when it was not.
    For users working with large Excel/VBA files, this is potentially a data-loss issue.
Image Image Image Image Image Image Image

I can provide screenshots, debug logs and additional reproduction information if required.

Steps to reproduce

After the problem is triggered, Excel starts producing several errors.
First Excel reports that VBA project features cannot be saved in a macro-free workbook, even though the workbook being used is an .xlsm file.
Excel then produces VBA Runtime Error 1004:
"No se puede usar esta extensión con el tipo de archivo seleccionado."
("The file extension cannot be used with the selected file type.")
Excel subsequently reports:
"Errors were detected while saving
C:\Nextcloud\Solarenergy\Presupuestos\copia borrador.xlsm"
Finally Excel reports:
"The document was not saved."
Screenshots of all these errors are available.1. Right click on the file
2. Click on Share Options
3. The share dialog does not display the option to share by e-mail

Expected behavior

No block archives when saved

Which files are affected by this bug

excel .xlsm

Operating system

Windows

Which version of the operating system you are running.

windows 10

Installation method

Official Windows MSI

Nextcloud Server version

uknnown

Nextcloud Desktop Client version

34.0.0-rc1

Did this occur after an update or on a clean installation?

Major version update (i.e. 4.0.0 → 33.0.0)

Are you using the Nextcloud Server Encryption module?

No

Are you using an external user-backend?

  • Default internal user-backend
  • LDAP or Active Directory
  • SSO - SAML
  • Other

Nextcloud Server logs

Additional info

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions