2014-06-14 2 views
1

epplus에 대한 Excel Interop 코드를 시작한 후 Excel 문서를 저장하려고했지만 기존 파일을 읽을 수 없습니다. 검색했지만 모든 결과는 웹 응용 프로그램과 관련이 있으며 데스크톱 응용 프로그램을 개발 중입니다. 이 통합 문서의 Microsoft Office 또는를 통해 생성 된 경우Epplus Desktop Application - 도메인의 신원을 확인할 수 없습니다.

System.IO.IsolatedStorage.IsolatedStorageException was unhandled by user code 
    HResult=-2146233264 
    Message=Unable to determine the identity of domain. 
    Source=mscorlib 
    StackTrace: 
     at System.IO.IsolatedStorage.IsolatedStorage._GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, Object& oNormalized) 
     at System.IO.IsolatedStorage.IsolatedStorage.GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, String& typeName, String& instanceName) 
     at System.IO.IsolatedStorage.IsolatedStorage._InitStore(IsolatedStorageScope scope, Evidence domainEv, Type domainEvidenceType, Evidence assemEv, Type assemblyEvidenceType, Evidence appEv, Type appEvidenceType) 
     at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) 
     at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) 
     at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.GetCurrentStore() 
     at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder..ctor() 
     at MS.Internal.IO.Packaging.PackagingUtilities.GetDefaultIsolatedStorageFile() 
     at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName) 
     at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary() 
     at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
     at MS.Internal.IO.Packaging.DeflateEmulationTransform.Decompress(Stream source, Stream sink) 
     at MS.Internal.IO.Packaging.CompressEmulationStream..ctor(Stream baseStream, Stream tempStream, Int64 position, IDeflateTransform transformer) 
     at MS.Internal.IO.Packaging.CompressStream.ChangeMode(Mode newMode) 
     at MS.Internal.IO.Packaging.CompressStream.Seek(Int64 offset, SeekOrigin origin) 
     at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Seek(Int64 offset, SeekOrigin origin) 
     at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Read(Byte[] buffer, Int32 offset, Int32 count) 
     at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer) 
     at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count) 
     at System.IO.StreamReader.ReadBlock(Char[] buffer, Int32 index, Int32 count) 
     at OfficeOpenXml.ExcelWorksheet.GetWorkSheetXml(Stream stream, Int64 start, Int64 end, Encoding& encoding) 
     at OfficeOpenXml.ExcelWorksheet.CreateXml() 
     at OfficeOpenXml.ExcelWorksheet..ctor(XmlNamespaceManager ns, ExcelPackage excelPackage, String relID, Uri uriWorksheet, String sheetName, Int32 sheetID, Int32 positionID, eWorkSheetHidden hide) 
     at OfficeOpenXml.ExcelWorksheets..ctor(ExcelPackage pck, XmlNamespaceManager nsm, XmlNode topNode) 
     at OfficeOpenXml.ExcelWorkbook.get_Worksheets() 
     at OfficeOpenXml.ExcelWorkbook.GetDefinedNames() 
     at OfficeOpenXml.ExcelPackage.get_Workbook() 
......... 
+0

이 문제를 해결할 수 있었습니까? 나는 나가서는 안되는 것과 비슷한 것을 가지고 있는데, 어떤 도움을 주시면 감사하겠습니다. – ccalboni

답변

1

("BF")를 그녀는 package.Workbook.Worksheets을 = :

Dim File As FileInfo = New FileInfo(DosyaAd) 
Using package As New ExcelPackage(File) 
    Dim She As ExcelWorksheet 
    She = package.Workbook.Worksheets("BF") 
End using 

난에이 오류가 발생했습니다 : 내 코드는 매우 단순 interop의 경우 통합 문서에는 EPPLus 라이브러리를 통해 사용할 수없는 기능 (예 : 줄 및 테마)과 here 목록이 포함될 수 있습니다.

경험이 없지만 워크 시트에 많은 콘텐츠가 포함되어있을 때 문제가 발생한다는 소식을 들었습니다.

+0

안녕하세요, 통합 문서에는 텍스트와 숫자 만 포함되어 있습니다. 다른 도서관에 간단하고 일하는 것에 조언 할 수 있습니까? – Rusel

+0

[NPOI] (https://npoi.codeplex.com)라는 라이브러리를 사용하고 있습니다. – Lucas

+0

또한 EPPlus를 사용하여 다른 Excel 파일을 읽으려고 했습니까? 파일 자체에 문제가 될 수 있습니다. – Lucas

관련 문제