Solved

Excel data to and from a Windows application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net - For Loop Error 5 36
Error login w2012 domain 6 63
Definitions and default visual studio colors 5 58
LINQ - C# to VB convertion 12 46
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

19 Experts available now in Live!

Get 1:1 Help Now