Obtaining Excel worksheet reference by worksheet name via C

0 votes

I'm currently obtaining a handle for an Excel worksheet by using the below C# code:

Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(15);
//Get the worksheet "SubSignOff" number

Is there any way that I can obtain the same by using the worksheet name "SubSignOff"?

Nov 10 in Others by Kithuzzz
• 20,660 points
27 views

1 answer to this question.

0 votes

Instead of using Excel.Workbook.Sheets collection, it's easier to access Excel.Workbook.Worksheet collection, that way you can utilize early binding.

I hope this helps you.

answered Nov 10 by narikkadan
• 37,660 points

Related Questions In Others

0 votes
1 answer

can somebody explain me what does "passing by value" and "Passing by reference" mean in C#?

To answer your question, “passing by value” ...READ MORE

answered Feb 10 in Others by Rahul
• 9,680 points
176 views
0 votes
1 answer

Activate last excel worksheet on worksheetlist with closedxml in c#

This will answer your question :  Changing sheet ...READ MORE

answered Nov 5 in Others by narikkadan
• 37,660 points
73 views
0 votes
1 answer

Referencing an Excel file, workbook, worksheet in C#

Try the following code. using System; using System.Data; using Excel ...READ MORE

answered Nov 19 in Others by narikkadan
• 37,660 points
23 views
0 votes
1 answer

How to Freeze Top Row and Apply Filter in Excel Automation with C#

Try this: // Fix first row workSheet.Activate(); workSheet.Application.ActiveWindow.SplitRow = 1; workSheet.Application.ActiveWindow.FreezePanes ...READ MORE

answered Oct 22 in Others by narikkadan
• 37,660 points
108 views
0 votes
1 answer

Microsoft.Office.Interop.Excel for Office 2007

Each client must install the  2007 Microsoft ...READ MORE

answered Nov 5 in Others by narikkadan
• 37,660 points
52 views
0 votes
1 answer

Using c# to select a worksheet in excel

Try this: Excel.Worksheet xlWorkSheetFocus = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(2); xlWorkSheetFocus.Activate(); I hope this ...READ MORE

answered Nov 14 in Others by narikkadan
• 37,660 points
35 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hello, yes u can find your birthdate using ...READ MORE

answered Feb 16 in Others by Edureka
• 13,640 points
142 views
0 votes
1 answer

Excel offset where reference is to another worksheet

Solution:  =OFFSET((INDIRECT(ADDRESS(1,1,,,"Sheet2")),ROW(),0,,) References: OFFSET(starting point, num of rows, num ...READ MORE

answered Oct 8 in Others by narikkadan
• 37,660 points
108 views
0 votes
1 answer

Absolute worksheet reference in excel cell formulas

Try this: =INDIRECT("Sheet1!C"&ROW()) READ MORE

answered Oct 10 in Others by narikkadan
• 37,660 points
54 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP