Copy one sheet from one excel to another without knowing the sheet name

hi,i’m so sorry for having to many issues.
there is two problems i have met:
1).if i don’t know the sheet name (only one sheet in the excel),how can i copy the sheet to another excel;
2) copy column “SUBJECT” in course.xlsx to student.xlsx based on column “ID”,like the following image.student.xlsx (8.7 KB)
course.xlsx (8.6 KB)

%E5%9B%BE%E7%89%87

If you create an output variable(wb) for Excel Application scope (WorkbookApplication)

wb.Sheets(0) should give the only sheetname (If not, may be wb.Sheets(0).Name) for read range.

You can write range the sheet to another excel using the same name.

Hi @chen,

Using Excel Application scope you can achieve this. Workbookapplication.sheet(0)
Refer the below xaml files.

student.xlsx (9.5 KB)
Sheets.xaml (16.2 KB)

course.xlsx (8.6 KB)

wb.GetSheets(0)
:stuck_out_tongue: That’s what I use.

Not sure .Sheets() will work but maybe it will?

@chen, Just to add, .GetSheets() creates an array so you can filter it or run it through a For Each.
To straight up filter it use some vb.net which if you are not sure that information can be looked up.

wb.GetSheets.Where(Function(x) x.ToString.Trim.StartsWith(Now.ToString("mm-dd")).ToArray(0)

The above example would pull in the sheet where the current date is on the sheet name.

Regards

Hangover Typing :stuck_out_tongue_winking_eye:

if i want to merge one column(if another column(ARTIST) in course) from course to student,can there be any invoke method.
the result like this:

Hi @chen,

use Remove Data Column activity to remove the ARTIST Column from the table.

Regards,
Arivu

can i only merge one specified column at the first