SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old August 6th, 2004, 07:50 AM
Paula Paula is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 65 Paula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 32 sec
Reputation Power: 4
Question Writing vba to launch excel charts from Access

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?

Reply With Quote
  #2  
Old August 6th, 2004, 08:13 AM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
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!

Reply With Quote
  #3  
Old August 6th, 2004, 08:48 AM
Paula Paula is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 65 Paula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 32 sec
Reputation Power: 4
Quote:
Originally Posted by spak111
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!

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?

Reply With Quote
  #4  
Old August 10th, 2004, 01:03 PM
Mythomep Mythomep is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Zaandam, The Netherlands
Posts: 70 Mythomep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 37 sec
Reputation Power: 4
Send a message via MSN to Mythomep
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Writing vba to launch excel charts from Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway