Getting data corrupted error while reading excel file with read range workbook activity

Hi Everyone,

I am data corrupted error while reading excel file with read range workbook activity, but i am not getting any error while same excel file with excel application scope.

I can’t use excel application scope because of some reason so that’s why i am posting this issue in the forum.

Error Message:
RemoteException wrapping System.IO.FileFormatException: File contains corrupted data.
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Validate(String fileName, ZipIOCentralDirectoryBlock centralDir, ZipIOCentralDirectoryFileHeader centralDirFileHeader)
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.ParseRecord(BinaryReader reader, String fileName, Int64 position, ZipIOCentralDirectoryBlock centralDir, ZipIOCentralDirectoryFileHeader centralDirFileHeader)
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.SeekableLoad(ZipIOBlockManager blockManager, String fileName)
at MS.Internal.IO.Zip.ZipIOBlockManager.LoadLocalFileBlock(String zipFileName)
at MS.Internal.IO.Zip.ZipArchive.GetFile(String zipFileName)
at MS.Internal.IO.Zip.ZipArchive.GetFiles()
at System.IO.Packaging.ZipPackage.ContentTypeHelper…ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)
at System.IO.Packaging.ZipPackage…ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming)
at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.OpenCore(String path, Boolean readWriteMode)
at DocumentFormat.OpenXml.Packaging.SpreadsheetDocument.Open(String path, Boolean isEditable, OpenSettings openSettings)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName) in C:\Projects\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 44
at UiPath.Excel.WorkbookFile.InitializeExistingWorbookFile()
at UiPath.Excel.WorkbookFile…ctor(String workbookPath, String password, Boolean createNew)
at UiPath.Excel.Activities.WorkbookActivity1.ConstructWorkbook(String path, String password, Boolean createNew) at UiPath.Excel.Activities.WorkbookActivity1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Can anyone please provide the solution for this issue?

Hello @Manjuts90

Can you share the excel which you are using and the screenshot of the property set for the Read range workbook activity.

Hi! Welcome to community,

Before using the excel try to kill the excel.

KillProcess ->"Excel"

And use workbook activities…

Try like this and let me know


@THIRU_NANI i have tried step suggested by still giving same error

@Rahul_Unnikrishnan I can’t share the excel file with due to some reasons as of now. Please find the screenshot of read range activity below. And also i have updated error message in the post.

Here are you trying to get the value only from A20 cell? Also, did you try with another excel?

@Rahul_Unnikrishnan For other files it is working fine

Can you copy the same data to another excel and try it once.
If its not working still, try to change the sheetname and make a try.

1 Like

Was this resolved? Experiencing the same issue for several workflows, workbook was working and now it’s giving a corrupted file error. Is this related to sheet name or some other property in the activity?

do you have any external links for this file?