LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default excel.h - How To? Add a new worksheet c++

Hi, I'm trying to create new Worksheets in my code but I really have
no clue how to...
here is part of my code.
the code I'm is really the one from this webpage: http://support.microsoft.com/kb/178781
but the problem is that they say nothing about creating a new
Worksheet.

Thanks for your help in advance.

//Header declarations..
_Application xlApp;
Workbooks wb;
_Workbook _wb;
Worksheets ws;


//Source
//Add Workbook
wb = xlApp.GetWorkbooks();
_wb = wb.Add(covOptional);
ws = _wb.GetSheets();


//Remove the 3 default sheets
_Worksheet selSheet;
selSheet = ws.GetItem(COleVariant((short)1));
selSheet.Delete();
selSheet = ws.GetItem(COleVariant((short)2));
selSheet.Delete();
selSheet = ws.GetItem(COleVariant((short)3));
selSheet.Delete();


If you want to rename any of these sheets is really easy//
selSheet = ws.GetItem(COleVariant((short)2));
selSheet.SetName("NonInteractive Mode Results");


-Jona

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare excel worksheet and output difference to new worksheet Deb Excel Discussion (Misc queries) 1 October 31st 08 02:26 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
excel 97: copy and paste values from one worksheet to another worksheet Kathy[_5_] Excel Programming 0 September 21st 03 03:03 PM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Excel Programming 1 September 3rd 03 11:34 AM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"