Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2003, 05:02 AM
Authorized User
 
Join Date: Jun 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can i manipulate excel charts from VB 6

Does anyone know of a site or have a sample code in VB6 that uses Excel charts to generate reports. I know how to put data in Excel but i would like to be able to determine the records to be displayed at runtime. please holla on my email ([email protected]) or here


LION OF JUDDAH!
__________________
LION OF JUDDAH!
 
Old July 24th, 2003, 05:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Foudn the following in the Office Automation Help file available from http://www.greggriffiths.org/webdev/both/excel/

Code:
Sub CreateXLChart()
    Dim xlApp As Excel.Application
    Dim xlChrt As Excel.Chart
    Dim TitleArray As Variant
    Dim DataArray As Variant
    TitleArray = Array("Dogs", "Cats", "Horses")
    DataArray = Array(34, 53, 12)
    Set xlApp = CreateObject("Excel.Application")

    xlApp.Visible = True
    xlApp.Workbooks.Add
    With xlApp.ActiveSheet
        .Range("A1:C1").Value = TitleArray
        .Range("A2:C2").Value = DataArray
        .Range("A1:C2").Select
    End With
    Set xlChrt = xlApp.ActiveWorkbook.Charts.Add()
    With xlChrt
        .Visible = True
        .Type = xl3DColumn
        .HasLegend = False
    End With
    Set xlChrt = Nothing
    Set xlApp = Nothing

End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Charts to Word Sanjo VB How-To 1 March 31st, 2007 12:07 AM
database to excel manipulate data weazy Excel VBA 1 June 9th, 2006 12:07 PM
Storing Images In Oracle & Manipulate Through VB 6 tutul128 Beginning VB 6 1 August 2nd, 2004 03:26 AM
Excel Charts in Word migalley Excel VBA 4 March 5th, 2004 02:47 PM
how to create a new series in excel charts pavankumar Excel VBA 0 November 7th, 2003 11:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.