I\'m trying to deploy an application that works fine on my development pc and some other workstations. However, some users receive an error that I can\'t seem to grasp.
I spoke too soon! This is just a really dumb error. I thought I'd give the solution so others might not fall into the same trap as I did ;-)
To analyse the problem further, I added following code to the constructor:
List sheets = new List()
foreach(XLS.Worksheet sh in _WSs)
{
sheets.Add(sh);
}
if(_OnXLSEvent != null) _OnXLSEvent(String.Format("\n\tSheets in WB: {0}\n\tFirst Sheet index: {1}, \n\tLast Sheet index: {2}",
_WSs.Count,
sheets[0].Index,
sheets.Last().Index));
This resulted in following log on my machine:
Sheets in WB: 3
First Sheet index: 1,
Last Sheet index: 3
But in following log on the target machine:
Sheets in WB: 1
First Sheet index: 1,
Last Sheet index: 1
Conclusion: the amount of worksheets that are standard added to a new workbook differ from user to user. Something to keep in mind!