|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I have an access program where the user can click a button which produced a report for them. But now they want to be able to view that report in graph format. As there are no graph type facilities in Access, I think what I need is to be able to open excel through code, pass the data used in the report and somehow get that to automatically display as a graph.
Is that even possible? Can I do something with ole objects? |
|
#2
|
|||
|
|||
|
This can be done through OLE objects, however, mostly with OLE Automation as you will need to write the data to excel. So yes, it is possible, but if you've never done OLE Automation before, it could get rather interesting! I would suggest doing a google search on Excel OLE Automation, as there is a lot of information regarding exactly how to do this and the syntax for it. If you have specific questions, however, feel free to post them here. I hope this helps!
|
|
#3
|
|||
|
|||
|
Quote:
I've read up on it now, and I think I can work out how to bring an excel object into access. But what I don't really understand is how i create the graph at that point in time. If it already existed then i can understand how i use ole objects to embed it into Access but i don't understand how to create the graph. Any ideas? |
|
#4
|
|||
|
|||
|
Hi,
The following code excerpt demonstrates how to create a chart in Microsoft Excel. If you understand this piece of code, it is easy to adapt it for your own use. Code:
Private Sub cmdCreateChart_Click()
Dim oExcel as Excel.Application
Dim oChart as Excel.Chart
Set oExcel = New Excel.Application
oExcel.Visible = True
oExcel.Workbooks.Add
oExcel.Range("A1").value = 3
oExcel.Range("A2").value = 8
oExcel.Range("A3").Value = 12
oExcel.Range("A1:A3").Select
Set oChart = oExcel.Charts.Add()
oChart.Type = xl3DColumn
End Sub
Now, the code above starts excel, sets some values in a new worksheet and then proceeds to create a chart based on the values. If you have any questions, feel free to ask. Also, look at the MSDN library for a complete discussion of the Excel object model. Grtz.© M. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Writing vba to launch excel charts from Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|