0
Reply

Cant get Excel drag-n-drop to work. Please help.

big_goon

big_goon

Feb 4 2005 6:34 PM
1.7k
Hello, When the user of my app selects some rows from an open excel file and drag-n-drops them onto my form, I need to be able to parse those rows and fill arrays that would match the original selected Excel rows. Is there any way the I can populate an array with data from CSV's that are just droppped onto the form? I tried parsing each line myself, using some regular expressions I found online, but they would fail if a cell in the Excel row contained quotes or commas. What I have right now is a streamreader which reads the dropped info. As long as there are more lines, I read the line, split it using comma as the delimeter, and fill an array. This works great if there are no commas or quotes within the excel cells. If there are, I cant just split the string on commas because I cant tell the difference between "real" commas and the delimeters. I see that when you drag-n-drop Excel rows onto say Wordpad, it gets it right (regardless of what is in the Excel row). I would like to be able to do the same (just fill arrays instead of displaying the data). Any help is GREATLY appreciated! Thanks -Flack