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, 2022 in Others by Kithuzzz
• 28,520 points
52 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, 2022 by narikkadan
• 52,760 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, 2022 in Others by Rahul
• 9,670 points
255 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, 2022 in Others by narikkadan
• 52,760 points
277 views
0 votes
1 answer
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, 2022 in Others by narikkadan
• 52,760 points
81 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, 2022 in Others by narikkadan
• 52,760 points
328 views
0 votes
1 answer

Microsoft.Office.Interop.Excel for Office 2007

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

answered Nov 5, 2022 in Others by narikkadan
• 52,760 points
213 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, 2022 in Others by narikkadan
• 52,760 points
86 views
0 votes
1 answer

Microsoft Open XML Read Excel file using SAX method row by row and finding cell data

I faced a comparable challenge. A bespoke ...READ MORE

answered Jan 6 in Others by narikkadan
• 52,760 points
69 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, 2022 in Others by narikkadan
• 52,760 points
314 views
0 votes
1 answer

Absolute worksheet reference in excel cell formulas

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

answered Oct 10, 2022 in Others by narikkadan
• 52,760 points
129 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