Read xlsx template and add rows to it and save it

Hi All,
I have template in xlsx which i want to read as it is and after reading it i need to add few rows to it and save it as a xlsx only.
Please find the screenshot of the template in xlsx.
How can i acheive this ?

Hi @vishal_nachankar ,

Could you provide more information as to what is the End Output that you require.

If you want to read the Excel as a Datatable, You may as well do so, However, If you read it from A1, you would get Column0, Column1, Column2 as column names as the Columns are merged.

If the Excel file is read from A2 and A2 values are unique, You could Read the Excel as a Datatable and you will have the second row values in Excel as the Column Names.

But we would require you to provide more information on what exactly is the requirement.

If this is the Final Output, You may Read the Excel from A2, Add rows to the Datatable, write the Datatable to the same Excel from Range A2.

Let us know what do you think of this Method

I want to read the template as per the screenshot ok then i need to add details to it and again save it as an xlsx only. Screenshot for reference

but in the final xlsx i need the first row also which has merged headers

@vishal_nachankar Could You try Checking the Method mentioned ?

but i dont want to lose the template as for each transactions i need to use the same template

@vishal_nachankar , In that case, You would need to Keep the Template in a Separate Folder, say Template, then you could create a Copy of the Template file to make it as the Output file and work on the Copied file.

any other solution for this

Hi @vishal_nachankar,

I think @supermanPunch have told you the correct approach. You can go with his approach.

Let us know if you still face any issues.

Good day @vishal_nachankar

You can use “Copy File” activity to replicate your template then use Excel Application Scope after for adding data rows.

Put the Template Path in “From” and the Destination Path (or the output file name) in “To”
On the range of “Write Range”, based on your template, you will start writing inputs on A3.

Best Regards,
Anthony Jr.

thanks @supermanPunch it is working…

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.