Using excel import wizard through code?

Posted by baron on Stack Overflow See other posts from Stack Overflow or by baron
Published on 2010-06-07T04:15:58Z Indexed on 2010/06/07 4:22 UTC
Read the original article Hit count: 212

Filed under:
|
|
|

I am creating a Generate Report button for some data in my application.

The report will just generate a CSV file, which I then automatically launch in excel.

Problem is with one of the data fields, is text and has leading zeroes (which I need to keep). When the file is automatically opened in excel, excel automatically trims these. Is there anyway I can get it so that it opens with the data in the format I want it.

I know you achieve this normally by opening the CSV file from within excel and can do the import wizard. So one potential solution would be to auto open the import wizard when the app launches this file. I don't know if this is possible.

Thanks for reading.

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio