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

Call MSChart

Status
Not open for further replies.

norason

Programmer
Jan 28, 2009
139
US
I have an MSChart1 on form fmMain. On it is a button Public Sub cmdDrawGraph_Click()

Public Sub cmdDrawGraph_Click()
Dim arr(1 To 16, 1 To 7)
arr(1, 1) = Val(LblGraphPoint1.Caption)
arr(2, 1) = Val(LblGraphPoint2.Caption)
arr(3, 1) = Val(LblGraphPoint3.Caption)
arr(4, 1) = Val(LblGraphPoint4.Caption)
...

On another form fmPrint I'd like to print the data from MSChart1.

I have another iteration of MSChart1 on the form fmPrint (because it kept giving me an error without it) and I have a button :

Public Sub CmdPrint_Click()
Call cmdDrawGraph
' Copy bitmap to clipboard
MSChart1.EditCopy
Printer.Orientation = vbPRORLandscape
MsgBox "Press OK to Print", vbExclamation, "PRINT GRAPH"
Printer.Print " "
' copy bitmap from clipboard
Printer.PaintPicture Clipboard.GetData(), 0, 0
Printer.EndDoc
End Sub

but I keep getting an error:

Sub or function not defined.

I think it is because I'm trying to call an event, but I don't know how to populate the MSChart1 data on the form fmPrint.

Thanks,

Gary


 
I've been working on other problems - I'll get back to this asap.

Thanks,

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top