
You'll need to configure the batch file before running. It will be followed by a number indicating where it is in the list. REM Edit this value to change the name of each short file. REM Edit this value to change the number of lines per file. xlsx file that uses the predefined template and incorporates data from multiple files.REM Edit this value to change the name of the file that needs splitting.
Add the variable OutputReport in the Workbook field. Add a Close Workbook activity underneath the Excel Application Scope activity. Drag a Save Workbook activity under the Remove Duplicates Range activity. In the Properties panel, add "A2:F" + (RowsCounter + 1).ToString in the Range field and "Sheet1" in the SheetName field. Drag a Remove Duplicates Range activity and place it under the Invoke Workflow File activity. Set the path of the WorkflowFileName as "MergeReports.xaml". Add an Invoke Workflow File inside the newly created Sequence. Add a Sequence container in the body of the Excel Application Scope activity.
In the Properties panel, add the variable OutputReportName in the WorkbookPath field, add OutputReport in the Workbook field and select the check box of the Visible option for making the file visible for everyone. Drag an Excel Application Scope after the Assign activity. Add the variable ReportFiles in the To field and the syntax Directory.GetFiles(ReportsFolderPath, "*.xlsx") in the Value field. Drag a new Assign activity under the Copy File activity. In the Properties panel, add the variable ReportTemplatePath in the Path field and the variable OutputReportName in the Destination field. Add a Copy File activity and place it below the Assign activity. This includes the current date and time in the file name. In the Properties panel, add OutputReportName in the To field and String.Format("Report-.xlsx", DateTime.Now) in the Value field. Add an Assign activity in the body of the Sequence. Drag a Sequence container to the Workflow Designer. In the Workflow Designer, select the Main tab. In the Properties panel, add the variable RowsCounter in the To field and RowsCounter + in the Value field. Drag an Assign activity below the Excel Application Scope activity named Output report. In the Properties panel, add the variable ReportTable in the DataTable field and "Sheet1" in the SheetName field. Add an Excel Append Range activity in the body of the Excel Application Scope activity. This creates the file visible for any user. Select the check box for the Visible option. In the Properties panel, add the name Output report in the DisplayName field and the value OutputReport in the ExistingWorkbook field. Drag a new Excel Application Scope activity and place it below the Excel Application Scope activity named Report file. Select the check box for the AddHeaders option so that the first row of the table to be identified as a header. In the Properties panel, add the value ReportTable in the DataTable field. Drag an Excel Read Range activity and add it inside the Excel Application Scope activity. This makes the file visible and read only to any user that accesses it without a password. Select the check boxes for the ReadOnly and Visible options. In the Properties panel, add the name Report file in the DisplayName field and the value file in the WorkbookPath field. Add an Excel Application Scope activity inside the Sequence. Create a new variable named ReportTable and of type DataTable. Create a new DataTable variable named ReportTable. Drag a Sequence container in the body of the For Each activity. In the Properties panel, set the TypeArgument field to String and add ReportFiles in the Values field. In the ForEach field add the value file. Drag a For Each activity to the Workflow Designer.
In the Workflow Designer, select the MergeReports tab. xlsx files: Report1, Report2 and Report3. In the project folder add the ReportTemplate.xlsx file and create a new Reports folder that includes the following. Choose to save the process in the same location as the Main process.
Open Studio and create a new Process named by default Main. This is how the automation process can be built:
You can find these activities in the package. It presents activities such as Excel Application Scope, Remove Duplicates Range, Save Workbook, Close Workbook, Read Range and Append Range.
#Mass rename tabs in excel how to
The example below explains how to create a single excel report file by extracting data from multiple excel report files that have the same structure.