Is it possible to use sheets names as an array in “Input Dialogue”?

Dears,

Is it possible to use sheets names as an array in “Input Dialogue” as follows :

Thanks in Advance

Hi @hsendel,

It’s possible to use sheets name in an array like the below-

YourArrayVariable={“Sheet1”,“Sheet2”,“Sheet3”,“Sheet4”,“Sheet5”,…,“Sheet10”}

Thanks & Regards,
Apurba

2 Likes

Thanks @apurba2samanta, but my query is to read the sheets from Workbook and insert them as array in “Options” in “Input Dialogue”.

Hi,

Yes it is possible, inside an excel application scope activity place a Get WorkBook Sheets activity. This will result you the sheet names in a List(Of String) datatype, so you need to convert this in the input dialogue options as yourListSheets.ToArray()

1 Like

Hi @hsendel,

Please try with the below -

Hope it will help you.

Thanks & Regards,
Apurba

2 Likes

@apurba2samanta, This will only create Sheets List, How to add them to “input dialogue” ?

sheets.ToArray will resolve this issue.

1 Like

Hi @hsendel,

Input Dialogue wants input from the user. So, you can’t get value directly in Input Dialogue .

Thanks & Regards,
Apurba

1 Like

Fine
hope these steps would help you resolve this
–use excelapplication scope and pass the file path as input
–in this activity we will be having a output property in the property panel named WORKBOOK. Get a variable from that property named out_workbook
–now while still being inside the excel application scope use a INPUT DIALOG BOX activity where in the options mention like this
out_workbook.GetSheets.ToArray()
which will give us sheet names as a option in input dialog box activity

Cheers @hsendel

1 Like

Great!!! @Palaniyappan, Last thing How to exclude some sheets from this array?

1 Like

can i have a example
Cheers @hsendel

Sure. Please find in attachment where I want to exclude Sheet 3 and 4Example.zip (8.9 KB)

1 Like

here you go itts resolved
hsendel.zip (8.8 KB)

Cheers @hsendel

1 Like

have modified the code pls hve a look on to it
Cheers @hsendel

1 Like

is it working
@hsendel

I got an error message at UiPath Level, I’m troubleshooting:
The project has the same name as a referenced package (“UiPath”). This scenario is not supported and will lead to dependency resolve issues.

remove the project.json and open the xaml
@hsendel

1 Like

Thanks a lot !!! Case Closed :slight_smile:

1 Like

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