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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating an ms excel chart using OLE

Status
Not open for further replies.

coredump

Technical User
Jul 9, 2001
7
US
Greetings:

I'm writing a VB6 program that I want to add OLE automation to. Basically, I want a user to enter some info into some forms, populate an excel spreadsheet then create and display a chart from the data. I'm familiar with basic OLE techniques, and I'm not having too much trouble with populating the spreadsheet, but I can't seem to find anything about creating a chart from the data. Also, does anyone know where I can find a fairly complete reference to the OLE objects for the MS office suite (97 or 2000)?

 
if you're familiar with OLE you shouldn't have too many problems.
I'm not sure of what exactly you can't do, but this example would create a column data chart with data within cells A1:B5:

With yourOLEinstance

Charts.Add

ActiveChart.ChartType = xlColumnClustered

ActiveChart.SetSourceData Source:=Sheets("Folha1").Range("A1:B5"), PlotBy:= xlColumns

ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"

End With


Hope this helps and let me know if you're still having problems

About references to the OLE Object I think even Microsoft hasn't given us proper documentation on this and I don't know when they will...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top