공유 된 네트워크의 다른 사용자가 열어 본 Excel 파일을 수정하여 변경 사항을 저장하려고합니다. 나는 다음과 같은 오류가 파일을 열려고 때 : 그건 그렇고다른 사용자가 열어 둔 Excel 파일에 쓰기
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 라이브러리를 사용하고 있습니다.
분명히 다른 프로세스에 의해 잠긴 파일을 사용할 수 없습니다 ... 복사본을 만들어 변경하고 원본이 더 이상 잠길 때까지 기다려야 할 수도 있습니다. – walther
사용자 프로세스를 종료 할 수 있습니까? –
이론 상으로는 자신의 컴퓨터에 액세스 할 수있는 권한과 올바른 사용 권한이 있지만 네트워크상에서 다소 까다로울 수 있습니다. – walther