Solved

Excel data to and from a Windows application

Posted on 2007-04-01
4
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 143

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 143

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

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