MicrosoftGraph

P

Patrice

Hi,

I steel run Access 2002 wiht Windows XP. And I have Microsoftgraph 10.0
object library in my VBA reference

I have a graph based on a query. That query has over 3999 lines but the
graph show me only 3999 lines. Is it a default value? Can we do someting to
unlock that. With Excel we can do graph over 25000 lines.

Thanks for any tips

Pat
 
A

Arvin Meyer [MVP]

Try using automation with Excel to support your graph.

Sub sCopyFromRS(strQry As String, strPath As String)
' Sends records to the first sheet
' Arvin Meyer 10/7/2008 Modified 11/3/2008

Dim rst As DAO.Recordset
Dim intMaxCol As Integer
Dim intMaxRow As Integer
Dim objXL As Object
'Dim objXL As New Excel.Application
Dim objWkb As Object
Dim objSht As Object
Set rst = CurrentDb.OpenRecordset(strQry, _
dbOpenSnapshot)
intMaxCol = rst.Fields.Count
If rst.RecordCount > 0 Then
rst.MoveLast
rst.MoveFirst
intMaxRow = rst.RecordCount
Set objXL = CreateObject("Excel.Application")
With objXL
.Visible = True
Set objWkb = .Workbooks.Open(strPath)
Set objSht = objWkb.Worksheets(1)
With objSht
.Range(.Cells(2, 1), .Cells(50, intMaxCol)).ClearContents
.Range(.Cells(2, 1), .Cells(intMaxRow, _
intMaxCol)).CopyFromRecordset rst
End With

End With
End If
End Sub

Then use a button to call it:

Private Sub cmdSendToXL_Click()
Call sCopyFromRS("qryValue2ExcelChart", "C:\Data\ExcelChart.xls")
End Sub

The code above clears the 50 rows (I need about 20) and fills the range that
the Excel chart uses. Change that to the maximum number of rows of your
Excel Range.
 
P

Patrice

Tank you very much. I tried it and it works.

But is that answer mean we can't show more then 3999 lines with
microsoftGraph?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top