Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 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 August 7th, 2006, 03:13 PM
Authorized User
 
Join Date: Mar 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default New keyword Usage

Wrox,
     Can someone tellme why this is invalid?

Dim JPGraphChart As Chart
Set JPGraphChart = New Chart

I have referenced the Graph 11 Library. Chart appears to be a ligitimate class. But I keep getting an "invaid use of New" error.

John P


John Pennington
 
United Parcel Service
w(404) 828 6934
c (770) 714 5975
__________________
John Pennington
 
United Parcel Service
w(404) 828 6934
c (770) 714 5975
 
Old August 8th, 2006, 06:51 AM
Authorized User
 
Join Date: Sep 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prabodh_mishra
Default

Graph 11 Library is not creatable. It can only hold already created object. You can use Excel.Chart or word.chart instead.

 
Old August 8th, 2006, 09:42 AM
Authorized User
 
Join Date: Mar 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, still doesn't work.

Dim JPGraphChart As Excel.Chart
Set JPGraphChart = New Excel.Chart

keeps giving me "Class does not support automation or does not support expected interface."

What does it take to create a chart in vb and export it as a file???


John Pennington
 
United Parcel Service
w(404) 828 6934
c (770) 714 5975
 
Old August 8th, 2006, 09:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

did you try google for the solution??

try this link...

http://www.vb123.com/toolshed/99_vbchart/vbchart1.htm

maybe it will help you...

HTH

Gonzalo
 
Old August 8th, 2006, 10:39 PM
Authorized User
 
Join Date: Sep 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prabodh_mishra
Default

    Dim exApp As Excel.Application
    Dim exWb As Excel.Workbook
    Dim JPGraphCharts As Excel.Charts
    Dim JPGraphChart As Excel.Chart

    Set exApp = New Excel.Application
    Set exWb = exApp.Workbooks.Add()

    Set JPGraphChart = Workbooks.Item(1).Charts.Add()
    exApp.Visible = True


Now you have a chart1 in your excel application....

Cheers
Prabodh






Similar Threads
Thread Thread Starter Forum Replies Last Post
usage of cdata vsempoux XSLT 1 July 11th, 2008 08:38 AM
about the usage of ant wangpan J2EE 5 June 12th, 2007 06:57 AM
CONTAINS keyword usage caterpillar SQL Server 2000 2 July 12th, 2006 01:19 PM
Software usage rajesh@sonimtech.com C++ Programming 0 October 15th, 2004 06:30 PM





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