Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 28th, 2005, 05:13 PM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create Excel.Chart and Save to MS Access OLE Obj

HELP!

I have successfully created an Excel.Chart using Access VBA code. The Excel.Chart is stored in an Excel file that I have created on my local directory.

Now I need to take that chart (picture only) and paste into a OLE Object data field so that my Access users can see the chart.

How do I do this using VBA code? I have not been able to find examples in browser searches.

Thanks

 
Old December 29th, 2005, 08:27 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I know this can be done with Excel VBA:

Worksheets("SheetName").ChartObjects(1) _
    .Chart.Export _
    FileName:="YourChartName.gif", FilterName:="GIF"

I am not sure how to call this Excel VBA from Access though, unless you create the chart programatically, then open Excel programatically, then use an autoexec macro that spits out the image to a folder, then finish the process by having Access pull the image in programatically.

BTW, even though Access has the capability to store images, I usually store the images in a network folder, then link the images to records based on the name of the image (for example, prefix the image names with the SSN of the patient) and then display a thumbnail of the image programatically. It keeps the Access file size small. Stored images will really bloat your Access app quickly.

HTH



mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the format of MS Excel Cells from MS Access hewstone999 Access VBA 0 March 7th, 2008 07:19 AM
Excel Chart Object In Access Report dorlesky Access VBA 0 July 26th, 2007 10:26 PM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM
Connecting to Excel in Access OLE Object Mack Classic ASP Databases 0 October 8th, 2004 03:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.