I\'m mocking VSTO objects and in one project (I didn\'t write) it has this code:
var listOfSheets = new List();
var mockSheets = Substitute.
This is a wild guess, but Office Interop arrays are 1 based, not 0 based. I havent looked into it but this may be defined in the metadata. Try this:
for (int i = 0; i < numSheets; i++)
{
listOfSheets.Add(Sheet);
listOfSheets[i].Name = MockSheetName + (i + 1);
`mockSheets[i + 1].Returns(listOfSheets[i]);`
}