ERROR: 'Error writing to file' when processing
Description

This message can occur for one of the following reasons:

  • There's no free disk space on the hard drive
  • A folder in the data path doesn't exist
  • You don't have sufficient access rights
  • The files are hidden
  • Antivirus software is restricting access
  • A non-standard character in the file name
  • Saving your bank reconciliation statement PDF
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. Download the latest version. 

Before you start 

If the issue persists, continue to the Restart the computer which holds the Sage data section.


▼ Restart the computer which holds the Sage data

The server can lock the file open, which prevents you from renaming it. To resolve this restart the server computer.

If restarting the server computer isn't possible, you can close the locked files:

  1. On the computer that holds the data, right-click Computer then click Manage.
  2. Expand Shared Folders, then select the Open Files folder.
  3. 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.

If the issue persists, continue to the Check that there's enough free disk space section.


▼ Check that there's enough free disk space
  1. Click Help then click About and in the Program Details area, make a note of the Data Directory.
  2. Press and hold the Windows key and press E.
  3. Click This PC.
  4. Select the data location, for example P:.
  5. Right-click the drive and select Properties.
  6. Check that free disk space is at least 5GB. If it’s less, contact your local IT to free up space.

Disk space on drive.  

If the issue persists, continue to the Check that the file mentioned has an extension of .ini section.


▼ Check that the file mentioned has 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.

If the issue persists, continue to the Check if the path in the message exists section.


▼ Check if the path in the message exists

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

If the issue persists, continue to the Check if you can create or rename the file in the message section.


▼ Check if you can create or rename the file in the message  
  1. Note the full path in the message, for example, C:\ProgramData\Sage\Accounts\2024\Company.000\ACCDATA\QUEUE.DTA.
  2. Browse to the relevant folder, in this example C:\ProgramData\Sage\Accounts\2024\Company.000\ACCDATA.
  3. Select the View drop-down menu, hover over Show and select the Hidden Items checkbox.
If the file exists
  1. Right-click on the file and click Rename.
  2. 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
  1. Click File, then click New, and click Text Document.
  2. Then type the full name of the file, for example, QUEUE.DTA and press Enter.

If the issue persists, continue to the Create the missing folder section.


▼ Create the missing folder 

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.

  1. Browse to the relevant folder, in this example, C:\ProgramData\Sage\Accounts\2024\Company.000\Reports.
  2. Click File then click New and click Folder and type the relevant folder name, in this example VAT.
  3. Press Enter.
  4. Double-click the new folder and click File then click New and click Folder.
  5. Type the relevant folder name, in this example Miscellaneous Reports and press Enter.

If the issue persists, continue to the Remove the hidden attribute on all files within Company.000 section.


▼ Remove the hidden attribute on all files within Company.000

NOTE: Complete this step on the computer which holds the data.

  1. Note the data path from the message, for example C:\ProgramData\Sage\Accounts\2024\Company.000.
  2. Click Start then click Run and enter CMD then press Enter.
  3. Enter CD\ and press Enter, enter CD and then first folder name. For example, CD C:\programdata and press Enter.
  4. Enter CD and the next folder name and press Enter. Repeat this for each folder up to Company.000.
  5. 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.

  6. Close the command prompt window, try the restore or back up again.

    If the message appears again and refers to a different folder, for example, Reports, repeat the steps on that 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:

  • C:\Users\<username>\AppData\Local\VirtualStore\Program Data\Sage\Accounts\2024

If the issue persists, continue to the Move the data to a new location section.


 ▼ Move the data to a new location

 

  1. Click Help then click About and in the Program Details area, make a note of the Settings Directory.
  2. Create a new folder on the computer which holds your Sage 50 Accounts data.
  3. If your data is on a server, share the folder and ensure that all relevant users have Modify permissions allowed.
  4. 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 don't exist:
    • Accdata
    • Archives
    • Attachments
    • Bitmap
    • Configs
    • Criteria
    • Defaults
    • Exports
    • Fax
    • HMRCSubmissions
    • Imports
    • Invoices
    • Journals
    • Labels
    • Layouts
    • Letters
    • Memo
    • Reports
    • Taskopt
    • Template
    • TMail
    • VATRtns

  5. Paste these folders into the new folder created in step 2.
  6. Browse to the settings directory noted in step 1 and double-click COMPANY.
  7. Select the program from a list then click OK.
  8. Choose Notepad and click OK.
  9. Change the path to the new folder location for the data.
  10. Click File then click Save and click File then click Exit.
  11. Try the restore or back up again.

Steps to duplicate
Related Solutions