Excel Export: File Deleted

This is relevant to users of Excel version 2202 released March 2022 (and presumably some versions before that). Users of Excel version 2206 (approximately) onwards (released in June 2022) - should not see this issue.

Companies on Microsoft's Semi-Annual Enterprise channel should be upgraded to 2208 or later on Tuesday 10 January 2023.

In the older versions of Excel then, after using FastClose Export to Excel feature, users see the report opened in Protected View, so it can't be edited until they click the "Enable Editing" button. However, on clicking that button, Excel complains that the file no longer exists and therefore can't be edited!

This is because in the background, FastClose has deleted the temporary file used to deliver the export to Excel.

A workaround, is to extend the time delay that FastClose uses, before deleting the temporary file. By default, the delete happens after a delay of 10 seconds, but the timing can be customized by editing a configuration file.

This has to be done on each PC running FastClose Designer or Reader.

The configuration file is C:\Program Files\FastClose\WindowsClient\FastClose.UI.WPF.Application.exe.config and because it is in the Program Files folder you will need administrative rights to be able to edit it. For example, launch Notepad as an administrator, then open the file.

6576fba0-f73c-46ba-9235-94d607b79a9c

Near the top of that file, find the line referring to ExcelExportTempFileDeleteDelaySeconds, uncomment it by removing the '<!--' and '-->' which enclose it and edit the value.

You can set a maximum of 120 (two minutes); any larger value will have no effect. In FastClose 2.5.3 and earlier, the minimum is 5 seconds. In FastClose 2.5.4 onwards, you can set it to zero and the temporary file will remain read-only and will never be deleted.

Background

In order to provide an export to Excel experience which doesn't require the user to provide a filename for the workbook up front, we write the export workbook as a temporary file. FastClose asks Windows to provide the unique filename within the temporary files folder, which is typically C:\Users\<username>\AppData\Local\Temp. The unique filename usually looks something like tmpDAE5.tmp.xslx.

So that Excel doesn't allow 'Save' for the file, but only 'Save As', we mark the file as read-only before asking Windows to open it. After a delay to allow Excel to start up and open the exported workbook, FastClose removes the read-only attribute from the file and then deletes it.

Excel Version Behaviours

With Excel version 2206 (approximately) onwards (released in June 2022 - see release history), the behaviour when it opens the workbook temporary file is:

However, in the earlier Excel version 2202 of March 2022 (and presumably some versions before that), Excel displays the workbook using Protected View, so it can't be edited until they click the "Enable Editing" button.

However if FastClose has deleted the temporary file before they click that button, Excel will complain that the file no longer exists and therefore can't be edited. Furthermore, if your company has Microsoft Defender configured to verify the file, it may take several additional seconds before the Enable Editing button is shown.

We are not aware of anything you can do to prevent Protected View in this scenario without losing the considerable security benefits of that feature.

Powered By