Solved

Excel data to and from a Windows application

Posted on 2007-04-01
4
144 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 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