cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
claudia
Helper IV
Helper IV

Extract data from web page Action fails with the error: Failed to write into excel

Hello everybody and Happy New Year!

 

I have created a flow to extract data from a web page. The flow was created with Web recorder.

It worked fine until yesterday (06/01/2022) when the flow started to fail at the action Extract data from web page with the error: Failed to write into Excel.

 

Please see below the Error details:

 

Microsoft.Flow.RPA.Desktop.Robin.Shared.Runtime.ActionException: Failed to write into Excel. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.GetProperty(Object o, String propertyName, Object[] arguments)
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.WriteToExcel(Variant excelInstance, Variant startCol, Variant startRow, Variant valueToWrite, Int32 writeMode)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.WriteToExcel(Variant excelInstance, Variant startCol, Variant startRow, Variant valueToWrite, Int32 writeMode)
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.CreateNewAndWriteDataTable(Int32 column, Int32 row, DataTable table, Int32 writeMode)
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.ExtractData.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

Please can you help me with this?

 

Thank you

Claudia

 

10 REPLIES 10
fraenK
Memorable Member
Memorable Member

Something might have changed in the Excel file which you have defined in your "ExcelInstance" variable.

Please review that or post your flow.

Hi @fraenK 

 

At this stage of the flow, I always open a new Excel file and after the data is extracted, I saved it on my computer.

claudia_1-1641544743021.pngclaudia_2-1641544783004.pngclaudia_3-1641544821958.png

 

 

fraenK
Memorable Member
Memorable Member

There should be a "new Excel" action before your extract data from webpage action, which defines your ExcelInstance variable/session. Can't find that in your screenshots?

If I use this action and if I extract the data in an ExcelInstance, the excel file is opened automatically, I don't need to Launch Excel. At least this is what I see in the running flow.

In the Microsoft documentation, for this action exist 3 exceptions:

claudia_0-1641546595357.png

I always received the error: Fail to write values to Excel.

 

If I use LaunchExcel before Extrac data from web page into ExcelInstance, it will be opened 2 excel files.

 

fraenK
Memorable Member
Memorable Member

Yes, sorry, you're right, it creates an instance.

Then there must be something wrong with the data your extracting, so it can't write that to an Excel file.

Who large is the table you are extracting?

Are there any special characters?

Did you try to copy paste the data into an empty Excel file? Was the data recognized correctly?

fraenK
Memorable Member
Memorable Member

Just tried https://webgate.ec.europa.eu/rasff-window/screen/search

Works fine for me. Did you check if all cells are extracted correctly using the preview of extract data from webpage action? There is also a CSV export, which might be easier to process?

I know that I can use the csv, but I don't understand why my flow is not working anymore because I didn't change anything.

fraenK
Memorable Member
Memorable Member

The website might have changed. If the CSV export provides the necessary data, then this is a better way to go compared to extracting data from a complex website "table".

Rkv_
Resolver II
Resolver II

Do yo have the Excel working fine on your machine? Please try launch excel action, check whether that is working or not.

Hi @Rkv_ 

 

Excel is working fine and the launch action also.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Top Solution Authors
Users online (1,357)