Is it possible to get sheet's names without opening Excel?

excel
activities
studio

#1

Could you please tell me whether it’s possible to get the sheet’s names of an Excel file without using Excel Application Scope and without opening the Excel program?


#2

Hi @MGMKLML,

If you want to get it inside UiPath then Excel Application Scope is mandatory, if you dont want to use it then write your custom code and use it else try with Invoke Code activity with some vb.net code which will get excel sheet names alone.


#3

Okay thank you. I thought it could be possible to do it via UiPath somehow :slight_smile:


#4

Yes you can get excel sheet name by using vbscript


#5

@indra, @sarathi125, thank you for your replies. Could you please help me with one more thing? I use Read Range activity from the Workbook section and store it in dt variable. So dt contains the table. There are 5 columns in this table. I want to write 2 columns from there to another Excel file. How do I do it?

For instance, dt has 5 columns: Col1, Col2, Col3, Col4, Col5. And I want to write Col2, Col3 to a new Excel file.


#6

using excel uipath or vbscript


#7

@indra, yes, but I can’t get how exactly I can do it. I’m using the Write Range activity. All I can think out now is just reading columns I want, store them in a separate variable and write the whole variable which is not comfortable in some cases. I would like to read the whole workbook, store it in a datatable variable and then address the exact columns I want via just one variable.


#8

@MGMKLML check attached zip file

ExlColToAnotherSheet.zip (8.3 KB)


#9

@indra, wow thank you a lot, it worked. Why are you using the ‘DefaultView’ method though?


#10

refer this link

https://msdn.microsoft.com/en-us/library/system.data.datatable.defaultview(v=vs.110).aspx


#11

@indra, thank you very much, it’s solved :slight_smile: Now I need to understand how to save the formatting but this is another story, thanks :slight_smile:


#12

Is it possible to get sheet’s names without opening Excel

How is this possible can u plz share xaml file.

I checked ur xaml file that is for copying data from one sheet to other sheet.
but i need to get names of excel sheet in a notepad or write line
Please help me in this .


#13

@Bharti_sanghmitra There is custom activity called Uipath Excel Extended Activities install this than you can get sheet name


#14

Hi Indra,

I installed and executed and using logic.
Still excel is getting opened.
PFA


#15

@Bharti_sanghmitra Install this package Uipath.Excel.Extended.Activities


#16

@Bharti_sanghmitra Download attached xaml file and in Excel Scope Just pass file path it will give sheet name

Excel_Sheets.xaml (7.6 KB)


#17