ERROR: File in use, or error creating file messages
Description
When creating or restoring a backup, you receive one of the following messages:
'Error creating file'
'Error opening file'
'Error writing to file'
NOTE:These messages can also appear when the software automatically saves files. For example, when reconciling your bank and saving the statement PDF.
This message can occur for one of the following reasons:
There's no free disk space on the hard drive
The data path in the Company file is the incorrect format
A folder in the data path doesn't exist
You don't have sufficient access rights
The files are hidden
The backup is corrupt
Antivirus software is restricting access
A non-standard character in the file name
You can resolve these errors by following the steps below.
Cause
Resolution
NOTE:To remove files to resolve this issue with the new rebuild option, you'll need to be using Sage 50 Accounts v31 or above. This makes the process easier and faster. Click here to download the latest version.
Make sure you're using the latest build of the software. If you're not, you can download and install the required Sage 50 Accounts software updates
If the above steps don't resolve the issue, click Next.
Check that there's enough free disk space
Click Help then click About and in the Program Details area, make a note of the Data Directory.
Press and hold the Windows key and pressE.
Click This PC.
Select the data location, for example P:.
Right-click the drive and select Properties.
Check that free disk space is at least 5GB. If it’s less, contact your local IT to free up space.
If this doesn't resolve the issue, click Next.
Check the path in the Company file is correct
Click Help then click About and in the Program Details area, click the path to the Settings Directory.
Double-click COMPANY and select the option Select the program from a list.
Click OK, then click Notepad, and click OK.
Ensure the path is correct and ensure there's no blank line at the top of the file. For example, \\Server01\SageData.
If you change the path click File, click Save and select File then click Exit.
If this doesn't resolve the issue, click Next.
Does the file mentioned have an extension of .ini?
For example: Error creating file C:\Program Files\Sage\Accounts\Desktop.ini
TIP: A file with the extension .ini is a configuration file which usually holds information about the folder options within a folder.
Delete the file and try to restore or back up again
The backup includes the file .ini which already exists in the folder where the backup restores to. This is a Windows system file so it can't be overwritten. Delete the file and restore the data again. The file will restore when the data does. So delete the file again to avoid the issue the next time you restore.
Note the full path in the message, for example, C:\ProgramData\Sage\Accounts\2024\Desktop.ini.
Browse to the relevant folder, in this example C:\ProgramData\Sage\Accounts\2024.
Select the View drop-down menu, hover over Show and tick Hidden Items.
Find the file in the message, in this example, Desktop.ini.
Right-click on the file and click Delete then click Yes. If you can't delete the file, click Next below.
Open Sage Accounts and try to restore or back up again.
If you're restoring, repeat steps 2 to 6.
Change the Folder Options back to their original settings.
If this doesn't resolve the issue, click Next.
Does the path in the message exist?
Browse to the folder in the message, for example, if the message is: 'Error creating file C:\ProgramData\Sage\Accounts\2024\Company.000\Reports\VAT\Miscellaneous Reports\TAXCODES.report'
Browse to C:\ProgramData\Sage\Accounts\2024\Company.000\Reports\VAT\Miscellaneous Reports
Can you create or rename the file in the message?
Note the full path in the message, for example, C:\ProgramData\Sage\Accounts\2024\Company.000\ACCDATA\QUEUE.DTA.
Browse to the relevant folder, in this example C:\ProgramData\Sage\Accounts\2024\Company.000\ACCDATA.
Select the View drop-down menu, hover over Show and select the Hidden Items checkbox.
If the file exists
Right-click on the file and click Rename.
Delete the last three letters, type OLD,then press Enter.
If you can't rename the file, it's likely locked open on the server.
If the file doesn't exist
Click File then click New and click Text Document.
Then type the full name of the file, for example, QUEUE.DTA and press Enter.
Create the missing folder and try the restore or back up again
For example, if C:\ProgramData\Sage\Accounts\2021\Company.000\Reports exists but the VAT folder is missing, create a new folder within Reports called VAT. Then create the remaining folders in the structure.
In this example, create a new folder in VAT called Miscellaneous Reports.
Browse to the relevant folder, in this example, C:\ProgramData\Sage\Accounts\2024\Company.000\Reports.
Click File then click New and click Folder and type the relevant folder name, in this example VAT.
Press Enter.
Double-click the new folder and click File then click New and click Folder.
Type the relevant folder name, in this example Miscellaneous Reports and press Enter.
Try the restore or back up again.
If this doesn't resolve the issue, click Next.
Restart the computer which holds the Sage data
If you can't rename the file, it's likely to be locked open on the server. To resolve this restart the server computer.
If restarting the server computer isn't possible, you can close the locked files:
On the computer that holds the data, right-click Computer then click Manage.
Expand Shared Folders, then select the Open Files folder.
To close a file, right-click the file, then click Close Open File to confirm, click Yes.
Try to rename the file again.
If you still can't rename the file, it can be due to your Windows permissions. Refer to your network administrator for further advice to check and amend Windows permissions.
If you can rename the file, try the restore or back up again
If this doesn't resolve the issue, click Next
Remove the hidden attribute on all files within company.000
NOTE: Complete this step on the computer which holds the data.
Note the data path from the message, for example C:\ProgramData\Sage\Accounts\2024\Company.000.
Click Start then click Run and enter CMD then press Enter.
Enter CD\ and press Enter, enter CD and then first folder name. For example, CD C:\programdata and press Enter.
Enter CD and the next folder name and press Enter. Repeat this for each folder up to Company.000.
Enter attrib-h /S /D, for example CD C:\ProgramData\Sage\Accounts\2024\Company.000 attrib -h /S /D then press Enter. The -h removes the hidden attribute. The /S ensures this applies to all files in the folder. The /D ensures this also applies to all the sub folders.
Close the command prompt window, try the restore or back up again.
If the message still appears but refers to a different folder, for example, Reports, follow the steps again on the relevant folder.
If this doesn't resolve the issue, check the Virtual Store. When Program Data is present in the Virtual Store, this can cause the issue. Check the path and if the named problem file is present, rename it. Example path:
Click Help then click About and in the Program Details area, make a note of the Settings Directory.
Create a new folder on the computer which holds your Sage 50 Accounts data.
If your data is on a server, share the folder and ensure that all relevant users have Modify permissions allowed.
Browse to the existing Sage Accounts data directory.
To check the data directory, open Sage Accounts, then click Help and About. The data directory is in the Program Details section.
Copy the following folders. Depending on your version, some of these folders may not exist:
Accdata
Archives
Attachments
Bitmap
Configs
Criteria
Defaults
Exports
Fax
HMRCSubmissions
Imports
Invoices
Journals
Labels
Layouts
Letters
Memo
Reports
Taskopt
Template
TMail
VATRtns
Paste these folders into the new folder created in step 2.
Browse to the settings directory noted in step 1 and double-click COMPANY.
Select the program from a list then click OK.
Choose Notepad and click OK.
Change the path to the new folder location for the data.
Click File then click Save and click File then click Exit.
Try the restore or back up again.
If the issue persists, click Next
Restore an alternative backup
NOTE: If the issue is backing up rather than restoring, we recommend you restart this process.
To test the backup for corruption, if possible, restore a different backup. If the backup restores successfully, it's likely that the original backup is corrupt.
For more information about data corruption, visit A to Z of errors article.