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
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