Search Unity

"File couldn't be read" - Unable to import csv in Unity 2018.4 while open in Excel

Discussion in 'Editor & General Support' started by andreasp, Sep 11, 2019.

  1. andreasp

    andreasp

    Joined:
    Jun 29, 2013
    Posts:
    14
    Since upgrading to Unity 2018.4 (from 2017.4), I'm unable to import csv files while they're open in Excel. When saving the file in Excel and going back to Unity, the following errors appear:

    [14:02:34] Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file C:/dev/data.csv: The process cannot access the file because it is being used by another process.
    [14:02:34] File couldn't be read

    Trying to manually reimport the file also fails with the same error. Reimporting only works after closing Excel where the file is also open.

    It seems the latest Unity attempts to open the file with a write lock for importing, which interferes with having the file open in external programs.

    Editing a file in an external program and returning to Unity to see changes is an important workflow - what can be done to fix or work around this issue?