Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2009, 05:12 AM
Authorized User
 
Join Date: Feb 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default VB.Net 3.5 To Read and Wtrite Excel

Any easy VB.Net sample code to read and to write an Excel file?
 
Old December 9th, 2013, 03:30 AM
Registered User
 
Join Date: Nov 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: VB.Net 3.5 To Read and Wtrite Excel

Hi, there are quite a few approaches to achieve this, but to me one of the easiest ways would be with this VB.NET Excel component.
It presents a workbook content in a very intuitive hierarchical structure, also it has a simple and clean API.
Here is a sample how you can read Excel files in .NET, make some simple changes on it and save it:
Code:
' Load Excel file.
Dim workbook = ExcelFile.Load("Workbook.xls")

' Select active worksheet.
Dim worksheet = workbook.Worksheets.ActiveWorksheet

' Change the value of the cell "A1".
worksheet.Cells("A1").Value = "Hello world!"

' Save the file in XLS format.
workbook.Save("NewWorkbook.xls")





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read an already open Excel file in VB.NET sunilr General .NET 4 February 28th, 2014 07:20 AM
read/send email using WEBDEV and vb.net prashanthudupa.k Excel VBA 0 September 21st, 2006 06:39 AM
Why use VB.Net to read Access? AmyEL VB.NET 2002/2003 Basics 3 February 24th, 2005 12:12 PM
Read text file and out to serial port VB.net noomkmitl Pro VB.NET 2002/2003 0 December 27th, 2004 08:44 AM
How to read out a outlook inbox in VB.NET splanky VB How-To 0 December 10th, 2003 11:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.