View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] mikebabb@cableaz.com is offline
external usenet poster
 
Posts: 2
Default Problem Naming Worksheet

I have a C# program accessing the Excel interop. No matter what I do,
I can't get the name of the active worksheet to change from "Sheet1".
Here's basically the code.

MSExcel.Application xlApp = null;
MSExcel._Workbook wkb = null;
MSExcel._Worksheet wks = null;
string sheetName = "Opportunites";

xlApp = new MSExcel.Application();
wkb = xlApp.Workbooks.Add(MSExcel.XlWBATemplate.xlWBATWo rksheet);
wks = (MSExcel._Worksheet) wkb.ActiveSheet;
wks.Name = sheetName;

Is there anything else I need to do?