Solved

Excel data to and from a Windows application

Posted on 2007-04-01
4
140 Views
Last Modified: 2013-12-25
I am new to programming so I do not know a lot of simple things so here goes.  How do I read 1 cell from Excel worksheet and put its contents into a textbox in a windows application also put data froma textbox into an excel cell? vb.net
0
Comment
Question by:teagardan
  • 2
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18832734
did you already look at code samples to automate Microsoft Excel as from vb.net?
http://www.google.lu/search?q=vb.net+automate+excel&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:de:official&client=firefox-a
it's almost straightforward...
0
 

Author Comment

by:teagardan
ID: 18833719
I am using VB 2005 and the examples are usually in vb 6 or earlier and they will not convert when I try to open them in visual studio 2005 I get errors.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18834422
the very first hit I got:
http://www.vbdotnetheaven.com/UploadFile/ggaganesh/ExcelSpreadsheet04182005093012AM/ExcelSpreadsheet.aspx

you need only to change the
Dim workbook As _Workbook = workbooks.Add
into:
Dim workbook As _Workbook = workbooks.Open("yourfilepath")

and
Dim range1 As Range = worksheet.get_Range("A1", Missing.Value)

then see point 5 to set the value



note this VERY important support note from MS about automating office applications:
http://support.microsoft.com/kb/317109

0
 

Author Comment

by:teagardan
ID: 18842707
Thank you I will give this a try today
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now