在Excel文件由另一个用户打开时写入

我试图编辑一个打开的Excel文件(由共享networking中的另一个用户),以便对其进行一些更改并将其保存回来。 但是当我尝试打开文件时出现以下错误:

Message=The process cannot access the file 'Y:\COMMON\SharedFolders\Export.xlsx', because it is being used by another process. Source=mscorlib StackTrace: à System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) à System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) à System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) à System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) à System.IO.File.ReadAllBytes(String path) à OfficeOpenXml.ExcelPackage.ReadFile() à OfficeOpenXml.ExcelPackage.ConstructNewFile(Stream stream, String password) à OfficeOpenXml.ExcelPackage..ctor(FileInfo newFile) 

顺便说一句,我正在使用EPPLUS库。

你不能。 这就是说,你可以看看一些“源安全”的解决scheme(如SVN,SharePoint或谷歌文档)。 你也可以实现一些“穷人”来源安全 – 即小型networking应用程序,将充当代理文件系统,并允许您上传文件,列表文件夹,下载文件。

其他的select是当没有人访问这个文件的时候延迟更新。

谷歌同时允许多个编辑…也许你应该尝试移动那里的文件,如果可能的话。