Overwriting Excel file from VB

S

satyam

My VB program generates data that is sent to a database table of
columns. At present I am using VB only to display that data usin
picture control. Now for enhancing my program I want to send th
generated data to a Excel file which I have created in the sam
application path (overwrite the file) and display two graphs based on
vs 2 and 1 vs 3 columns. How to do? For calling Excel program from VB
am using code like this:

Dim xl As New Excel.Application
xl.Visible = True
xl.Workbooks.Open (App.Path & "\book1.xls")

How to send data to respective columns in excel file from vb
 
J

Jon Peltier

Assuming you correctly dimension the array and the target range, a
simple line like this puts the array into the worksheet.

xl.activesheet.range("B1:B10").Value = vbArray1

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top