Robotic Process Automation

  • 1.  Opening a simple Excel file is not working

    Posted Fri August 06, 2021 06:39 PM
    Hi!

    When trying to open a simple Excel file the following error is generated:

    OfficeOpenXml.Packaging.Ionic.Zip.BadReadException: Unexpected size (0x0004) for NTFS times extra field at position 0x0000000000000B14
    em OfficeOpenXml.Packaging.Ionic.Zip.ZipEntry.ProcessExtraFieldWindowsTimes(Byte[] buffer, Int32 j, Int16 dataSize, Int64 posn)
    em OfficeOpenXml.Packaging.Ionic.Zip.ZipEntry.ProcessExtraField(Stream s, Int16 extraFieldLength)
    em OfficeOpenXml.Packaging.Ionic.Zip.ZipEntry.ReadHeader(ZipEntry ze, Encoding defaultEncoding)
    em OfficeOpenXml.Packaging.Ionic.Zip.ZipEntry.ReadEntry(ZipContainer zc, Boolean first)
    em Ionic.Zip.ZipInputStream.GetNextEntry()
    em OfficeOpenXml.Packaging.ZipPackage..ctor(Stream stream)
    em OfficeOpenXml.ExcelPackage.ConstructNewFile(String password)
    em WDG.Automation.Windows.EpPlusWorkbookWrapper..ctor(FileInfo file, Boolean saveChanges, Boolean calculateOnSave, String passwordToOpen)
    em WDG.Automation.Windows.ExcelOpenCommand.Execute(WindowsContext context)
    --- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
    em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    em WDG.Automation.Language.ErrorHandler.lUFtgfS6B3UXYO8FnHA(Object )
    em WDG.Automation.Language.ErrorHandler.mGnpEI0m8x(Exception )
    em WDG.Automation.Language.ErrorHandler.HandleExecutionExceptionIfNeeded(Exception exception, IAutomationCommand command)
    em WDG.Automation.Language.CommandInterpreter.<Run>d__12.BjWVfHiEeDw1YyIIoxS(Object , Object , Object )
    em WDG.Automation.Language.CommandInterpreter.<Run>d__12.MoveNext()
    --- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
    em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    em WDG.Automation.Language.ScriptInterpreter.<RunCore>d__17.MoveNext()

    Here is the code snippet:

    defVar --name varSucesso_Excel --type Boolean
    defVar --name varArquivo_Excel --type Excel

    excelOpen --file "D:\\Arquivo de Teste.xlsx" --savechanges  varSucesso_Excel=success varArquivo_Excel=value
    delay --timeout "00:00:01"
    excelClose --file ${varArquivo_Excel} --save

    ------------------------------
    Mauro Sérgio
    ------------------------------


  • 2.  RE: Opening a simple Excel file is not working

    Posted Tue August 10, 2021 09:54 AM
    After testing the spreadsheet, it was possible to verify that there was a problem in the creation of the Excel file.
    As a workaround, I added the commands to open, save and close the spreadsheet using the Office command (officeOpen, officeSave, officeClose), with this Excel fixed the flaw, and later it was possible to open it with the excelOpen command.



    ------------------------------
    Angelo Alves
    WW Elite Team IBM RPA
    ------------------------------



  • 3.  RE: Opening a simple Excel file is not working

    Posted Tue August 10, 2021 12:45 PM
    Thanks Angelo, I will follow your recommendations.

    Regards,

    ------------------------------
    Mauro Sérgio
    ------------------------------