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: 3
Default Adding worksheets

Hello, I guess this is kind of basic stuff, but I would be very
pleased if you could help me anyway. Im trying to add a number of
sheets to a workbook in vsto (c#). I use a list to add several sheets.
the interesting code is pretty much:

List<Excel.Worksheet ws;

ws = new List<Excel.Worksheet();
for (int i = 0; i <= theend; i++)
{

ws.Add((Excel.Worksheet)Globals.ThisWorkbook.Works heets.Add(missing,
missing, missing, missing));
//a lot of code after this:

}

This work the first time in the loop, the other time though I get an
ArgumentOutOfRangeException when it hits any of the ws objects. I may
have done this completely wrong, but Im new with this so have patience
plz ; )

 
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
Adding Across WorkSheets computerangel Excel Worksheet Functions 0 July 8th 08 06:08 PM
adding worksheets sorab Excel Discussion (Misc queries) 1 September 5th 06 02:41 PM
adding worksheets together Gary Excel Discussion (Misc queries) 1 June 27th 05 08:26 PM
Adding worksheets mike clay Excel Programming 1 April 28th 04 09:38 AM
Adding Worksheets Peter[_33_] Excel Programming 6 January 16th 04 04:54 PM


All times are GMT +1. The time now is 09:30 PM.

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

About Us

"It's about Microsoft Excel"