Tuesday, 15 May 2012

vb.net - .net - import an excel file and remove certain rows -



vb.net - .net - import an excel file and remove certain rows -

i'm looking upload excel file, open , read through each row , perchance remove row depending if 1 cell contains values.

i have upload working:

protected sub buttonuploadfile_click(byval sender object, byval e system.eventargs) handles buttonuploadfile.click if fileuploadexcel.hasfile seek fileuploadexcel.saveas(server.mappath("~/excelimport.xls")) labelupload.text = "upload file name: " & _ fileuploadexcel.postedfile.filename & "<br>" & _ "type: " & _ fileuploadexcel.postedfile.contenttype & _ " file size: " & _ fileuploadexcel.postedfile.contentlength & " kb<br>" grab ex exception labelupload.text = "error: " & ex.message.tostring end seek else labelupload.text = "please select file upload." end if end sub

so have @ moment called excelimport.xls

dim oexcelapp excel.application = nil dim sfilename string = "~/excelimport.xls"

this far i've got ...but not exclusively sure rest.

any ideas?

thanks,

i seek utilize 3rd party library excel parsing. unless have requirement access via com interface... library found time ago open source , gives me plenty flexibility need in excel. check out this link library , quick illustration on how utilize it. hope helps.

.net vb.net

No comments:

Post a Comment