Dictionary: Read the Excel file with the report names and convert it to a dictionary. The Key-Value pair could have the Report name as the key and the value could be whatever you wish to track. For example: {“ReportName1” : “Success”, “ReportName2”: “Processing”,…}
Use the DataTable and For Each: Store the Names of the 36 reports in an Excel. You could loop through the reports and process them individually. For example:
Dim configData As DataTable = ReadExcel("config.xlsx")
For Each row As DataRow In configData.Rows
If reportType = row("ReportType").ToString Then
' Execute the processing logic stored in the row
End If
Next
Use Switch Cases: But this will be similar to an If Else, you need 36 cases and it will not be dynamic (if the number of reports changes). But it’ll will faster than an If-Else ladder.
If you can explain the use-case further with more contaxt, I can provide a better answer. For now, I’d recommend 2nd solution
If this solves your issue, Do mark it as a solution.
Happy Automation