Overview
An Excel file in M-Files with embedded metadata may throw a Type Mismatch error when opening the document:
CoMSExcelApplicationEventSink.cpp, 210, Type mismatch. (0x80020005)
MSExcelApplication.cpp, 789, Type mismatch. (0x80020005)
MSExcelApplication.cpp, 1523, Type mismatch. (0x80020005)
MSExcelApplication.cpp, 2137, Type mismatch. (0x80020005)
(M-Files 25.6.14925.4 2025-06-25T07:19:53.162Z)
Details
This error occurs when a locked cell with a formula is merged with an unlocked cell. The resulting merged cell is in a state where the 'locked' value is null, rather than the expected true or false, which causes the Type Mismatch error to be thrown.
This issue applies to M-Files Desktop versions 25.5, 25.6, and 25.7.
Solution
A fix for this issue has been included in the M-Files Desktop release version 25.8, updating to this version or a later version will resolve this issue.
Workaround
As a workaround, make sure the cells with formulas are locked. Excel will produce a warning when a cell with a formula is not locked, and this warning can be used to lock the cell:
Alternatively, you can right-click the cell and select Format Cells…, then select the Protection tab and check the Locked checkbox:
If you want to easily check all cells in the current sheet for errors, the Formulas > Error Checking option will go through each cell with an error and let you lock them there:
Once the cells that have formulas in them are locked, save the document, and the next time you open the document the error should no longer appear.
