I'm having to pull in data from a spreadsheet, but the header row is causing a lot of problems. My first column is a 6 digit ID but it's a string also, the interop wants those fields to be a Double. How can I make sure everything is just a string as it's passed over?
I'm using range.Cells[i,j].Value2
Excel Interop problems
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sam HobbsRank #108 · 20.5K reputationPosted Sep 2, 2011, 8:57 AM EDT
Jason31 reputationPosted Sep 2, 2011, 9:10 AM EDT
My last bump in the road seems to be that values.GetValue(i ,1).Equals(null) doesn't catch the null. I keep getting a NullReferenceException.
Sam HobbsRank #108 · 20.5K reputationPosted Sep 2, 2011, 10:09 AM EDT
VulpesRank #55 · 29.2K reputationPosted Sep 2, 2011, 10:10 AM EDT
I'd just use:
if (values.GetValue(i,1) == null)