How to get all the sheet names of excel without opening excel

Want to get alll sheets names present in excel without opening excel
Help!!!1

Hi @anishakotian400
Use get sheet activity to get all sheet names in excel

Regards,
Nived N

Hi

Hope the below steps would help you resolve this

—use a excel application scope and pass the filepath as input and from that activity get the output with a variable of type Workbook named Out_workbook

—then use a assign activity like this to get the sheet names

Arr_sheetnames = out_workbook.GetSheets.ToArray()

Arr_sheetnames is a variable of type Array of string

Or

You can try with custom activities

Cheers @anishakotian400

1 Like

Hi,

Hope this may help you, considering without using excel activities,

4 Likes

Using “get workbook sheets” within an Excel scope should get you all the wanted names without opening the workbook.

Regards,
Mustafa

Excel scope actually opens it, though.

2 Likes

Indeed, just noticed it opened it too fast for my eye to catch it. My bad !

Hi @anishakotian400

please use the below in assign activity

YourVariable(Type)XLWorkbook=new ClosedXml.Excel.XLWorkbook(“yourfilepath”)
YourVariable(Type)IXLWorksheets=Workbook.WorkSheets

It will list all the sheets without using excel application Scope!

Regards

2 Likes

You can actually make it Ina way not opening excel file by disabling VISIBLE property

@anishakotian400

It still opens it, just not visibly.

1 Like