I had this same issue. My problem stemmed from my code. I had a really long code line, so I hit enter several places to break up the code and this caused my problem. It was trying to enter an invisible return carraige in my excel formula and would cause the program to crash. Removing my line breaks in the code fixed it.
Here is the long line I tried to break up. Works fine now.
newWorksheet.Cells[8, 7] = @"=TEXT(IF(ISNA(OFFSET(OFFSET(BGPM1000XX!M12,0,11*0),MATCH(BGPM1000XX!B5+0.001,BGPM1000XX!A12:OFFSET(BGPM1000XX!A12,7,0),-1),0)),OFFSET(OFFSET(BGPM1000XX!M12,0,11*0),MATCH(BGPM1000XX!$B$5-0.001,BGPM1000XX!A12:OFFSET(BGPM1000XX!A12,7,0),-1),0),OFFSET(OFFSET(BGPM1000XX!M12,0,11*0),MATCH(BGPM1000XX!$B$5+0.001,BGPM1000XX!A12:OFFSET(BGPM1000XX!A12,7,0),-1),0)),""$#,#00"")& "" - "" &TEXT(IF(ISNA(OFFSET(OFFSET(BGPM1000XX!O12,0,11*0),MATCH(BGPM1000XX!B5+0.001,BGPM1000XX!A12:OFFSET(BGPM1000XX!A12,7,0),-1),0)),OFFSET(OFFSET(BGPM1000XX!O12,0,11*0),MATCH(BGPM1000XX!$B$5-0.001,BGPM1000XX!A12:OFFSET(BGPM1000XX!A12,7,0),-1),0),OFFSET(OFFSET(BGPM1000XX!O12,0,11*0),MATCH(BGPM1000XX!$B$5+0.001,BGPM1000XX!A12:OFFSET(BGPM1000XX!A12,7,0),-1),0)),""$#,#00"")";
Updated 21-Jan-14 9:10am
v2