Reference using Excel with VB.NET

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I am having a heck of a time trying to learn how to
manipulate Excel from Visual Basic.NET. Does anyone know
of any good reference articles or books that address this
subject specifically? I found one article on MSDN
called "Understanding the Excel Object Model from a .NET
Developer's Perspective" which is good but I need more
details such as how to open and existing spreadsheet,
copy data from one range of cells on one worksheet to a
range of cells on another worksheet, etc. I am using
WindowsXP Home and Visual Studio.NET 2003.
Any help will be truely appreciated!
Regards,
Lee
 
I believe, once you get your reference to the excel application, you just
use the Excel object model to do the rest

oxlApp.Workbook.Open "C:\my Documents\Myfile.xls"
oxlApp.Activesheet.Range("A1:B20").Copy Destination:= _
oxlApp.ActiveSheet.parent.Worksheets("Sheet3").Range("C32")

There is a lot of sample code in the Knowledge Base

You can look at this page as a start as well:

http://msdn.microsoft.com/office/understanding/vsto/
Visual Studio Tools for the Microsoft Office System

It is all about .Net and Office.
 
Back
Top