I have been having trouble trying to save a workbook with a numbe of sheets. My program works by working with an array (like a workbook) of 2D object arrays (analogous to worksheets), instead of working directly with Excel Interop. Once the program is done doing its thing, it copies the arrays to the Excel worksheets like this:


// sheets is a Sheets object and contains all of the sheets (3 or more)
// sheetArray (like a workbook) is the array of 2D object arrays (analogous to worksheets)

Worksheet tempSheet;
object[,] tempArray_sheet;

for (int i=0; i < sheet.Length; i++)
{
tempArray_sheet = sheetArray.getSheet(i);
tempSheet = (worksheet)sheets[i + 1];
tempSheet.UsedRange.set_Value(XlRangeDataType.XlRangeValueDefault, tempArray_sheet);
}

workbook.Save();
The odd thing is that the first sheet saves correctly, but the rest dont save at all...

Does anybody have any ideas???

Rich