Creating and populating an excel worksheet from VB.Net 2005.

How do I create an Excel workbook and worksheet, set data types for cells and transfer data to the worksheet?
Chuck_LoftinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Chuck_LoftinAuthor Commented:
Thanks, the "code behind" hint really made it work for me.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Glad I could help and thanks for the grade!
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Chuck_LoftinAuthor Commented:
I've kind of had mixed results with this site, but you really nailed the solution in a way that I didn't have to to any extensive research to apply the results. The only other thing that I can see right now that I might give me a problem later is setting the data type for a range of cells. I don't see a way to do that, however it might not even be a problem. I won't know until I get the specs for the spreadsheet.
0
Jorge PaulinoIT Pro/DeveloperCommented:
If you have any problem when you get the spec just say it!
0
Chuck_LoftinAuthor Commented:
How would I format a cell from VB.Net to display a given number of decimal places?
0
Jorge PaulinoIT Pro/DeveloperCommented:
It depends the method that you have follow, but you can do:

    Selection.NumberFormat = "0.00"

If you choose this on (sheet.Cells(i, 1) = f.Name) then you must format after add the value:

sheet.Cells(i, 1).NumberFormat = "0.00"
sheet.Cells(i, 1) = f.Name
0
Chuck_LoftinAuthor Commented:
Works great, I'm trying to find a good source of documantation for the Microsoft.Office.Interop.Excel namespace. Any suggestions on where to find this information?
0
Jorge PaulinoIT Pro/DeveloperCommented:
0
Chuck_LoftinAuthor Commented:
You've been very helpful. Thank you.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Just glad I could help you. Good luck with your projects.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.