View Single Post
Old Mar 6th, 2008, 2:12 PM   #1
Shaythen
Newbie
 
Shaythen's Avatar
 
Join Date: Mar 2008
Posts: 6
Rep Power: 0 Shaythen is on a distinguished road
Using VB to automate chart creation in excel.

I've recently been tasked to create a program that will open an excel file, gather data and then on a new sheet (same workbook or not) display the data in the form of a chart. I figure VB is the way to go, but I'm not well versed. Here is my initial code:

        Dim dBfile As Excel.Application
        dBfile = New Excel.Application

        dBfile.Workbooks.Open("c:\file\name.dbf")

        dBfile.Visible = True

This seems to work great for opening and displaying the file but I'm at a loss for what to do next. I thought maybe I could record a macro of me creating a chart and then do cut/paste action with the macro script. This, however, turned out to be quite sloppy. I figure I need to declare some chart, then use some inherent method to create it. Any general feedback on what to try is much appreciated.
__________________
"Either write something worth reading or do something worth writing."
-Benjamin Franklin
Shaythen is offline   Reply With Quote