[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

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?
0
Chuck_Loftin
Asked:
Chuck_Loftin
  • 6
  • 5
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now