Question on create separate worksheet and excel

I need to create a sheet in every month.
But also it will create a separate excel in every year.

For example:
2020 Jan to Dec are totally 12 sheets.
2021 Jan to Dec will be in other excel file.

How can I do that?

There is few ways to do it :

  1. You can do it with Invoke VBA :

Call a Excel Application Scope, with a random xlsx file, and inside this excel app scope, use the Invoke VBA Activity.

  1. With UiPath, you can first create the files using WriteRange (From Excel.Activity) :

And then create the new sheets using the same activity

So, what I can recommand is to split your data into few datatables splitted by years and month. Then simply loop through your list of datatable and create the files and the sheets using the WriteRange activity.

Good luck :smile:

1 Like

To create a new file, you can use Excel Scope Activity with a new filename and the option CreateNewFile marked.

To create a new sheet on an existing excel file you can do as follow: