Want to get alll sheets names present in excel without opening excel
Help!!!1
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
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.
Indeed, just noticed it opened it too fast for my eye to catch it. My bad !
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
You can actually make it Ina way not opening excel file by disabling VISIBLE property
It still opens it, just not visibly.