I wanted to get the excel sheet names with out opening the excel and then I want do so operation in each sheet

How to slow this to get the excel sheet names with out opening the excel

Please help me on this ggggh

Hi @Naveen_Kanike

Use the below code in Invoke Code:

Dim app As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
app=New Microsoft.Office.Interop.Excel.ApplicationClass
app.Visible=False
app.AskToUpdateLinks=False
wb=app.Workbooks.Open(ExcelFilePath,False,False)
shArray=wb.Worksheets.Cast(Of Microsoft.Office.Interop.Excel.Worksheet).Select(Function(x) x.Name).ToArray
wb.close

Invoked Code Arguments:

Create a variable arr_SheetNames in your workflow of DataType Array(System.String) and map with the arguments which will store all your Sheet Names after reading the excel.

Regards

Hi @Naveen_Kanike

Hi,

The following post may help you. This works even if Excel is not installed.

Regards,

@Naveen_Kanike,

Use Classic activity Get Sheets

If it’s not visible in your activities panel, click on the filter icon on activity panel and check Classic.

Thanks,
Ashok :slight_smile:

What are the index I need to write

If you want to do an operation in each sheet, just use For Each Excel Sheet

Here I used read range workbook activity to get ready the excel file then I used the get workbook sheets then what should I write in output sheets? Here I don’t know how many worksheets are there?

Hi @Naveen_Kanike

Write this code in Invoke Code and run a For Each loop for arr_SheetNames and in Read Range Workbook pass currentText in the place of SheetName.

Regards

@Naveen_Kanike,

Use like this:

image

This will return you array of string which will hold all sheet names in the file.
For understanding I have printed it in log message. You can utilize it as you wish.

Input file:

Output:

Get Sheets.xaml (10.8 KB)

Thanks,
Ashok :slight_smile:


Error is coming in string of array

Hi @Naveen_Kanike

Vairable also should be Datatype of Array(System.String)

Regards

After this what should I do error is cleared now next?

@Naveen_Kanike

run a For Each loop for arr_SheetNames and in Read Range Workbook pass currentText in the place of SheetName and read the sheet. What is the process you want to do after retrieving Sheet Names.

Regards

Exception has been thrown by the target of an invocation error message is coming

Hi @Naveen_Kanike

Can you share the excel which you are using I will help you with the workflow.

Regards

After this I want to create a newfolder for each of the worksheet with the same name

Check the flow @Naveen_Kanike

Input Sheets:
image

Check the below flow:
Sequence38.xaml (9.7 KB)

Output Folders:

Regards

New Microsoft Excel Worksheet.xlsx (10.6 KB)
This is the dummy data same format of the actual work i need to do

Hi @Naveen_Kanike

Check the below zip file:

ExcelSheetNames.zip (48.5 KB)

Let me know if it meets your requirement

Regards