Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to Excel

Status
Not open for further replies.

mythili

Programmer
Jul 15, 2002
9
US
I want to read from a text file and populate a excel file and from the excel file i want to show a graph in visual basic.Can anyone help me in this.
(If possible without using excel how to show data in vb charts).
 
Depending on what complexity you need in your chart, you may be able to use the MS Chart Control (MSCHRT20.OCX)
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
your post is a little confusing:-

>I want to read from a text file and populate a excel file
>If possible without using excel

but here goes(very simplified):

first you need the excel object library.
project->reference->microsoft excel x.x object library (9.0 for office 2000 i think)

you declare the excel object simply as

dim withevents MyExcelObject as excel.application

to write values to cells

MyExcelObject.Workbooks.Add
MyExcelObject.Cells(4, 8) = "hello there"
MyExcelObject.Visible = True

obviously theres plenty of code ive not put in but this should set you on your way.

if your looking to just create the excell file: the following site was referenced in another thread (not looked at it so i dont know if its any good)


as for graphs ive still not figured out how to stick a graph in vb other than using microsoft excel chart insertable object.

hope this gets you started and good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top