Link to home
Start Free TrialLog in
Avatar of Kev
KevFlag for Australia

asked on

Ms Access 2003 Copy Chart Object in Cache

Hi,

This seems like it should be so simple, but it aint... lol or maybe I am just jet lagged...

I have a Ms Acess 2003 chart object 'chtAIRN' I have a cmd button on the form called cmdCopy. I want users to be able to click the button and it copies the chart object into cach so that they can use the chart in other locations such as word and powerpoint.

I have tried a few options but nothing seems to work. I know users can select the chart then select copy from the edit menu, but I want to make it even easier for users.

The other option is to send the image to a jpg file on the desktop.

Any help is greatly appreciated.

Kev
ASKER CERTIFIED SOLUTION
Avatar of thenelson
thenelson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kev

ASKER

I am increasing points value to equally recognise both contributions.
Avatar of Kev

ASKER

Hey,

Thanks very much. Both solutions are perfect.

Thenelson, I did try that approach while at the airport yesterday but for the life of me could not get it to work. I am not sure what I was missing, but clearly I was not at my best.. lol.

Puppydogbuddy, while thenelsons solution worked and was first, yours gave me the solution to that allows the automations between access and powerpoint, something I have been investigating. It also gives me the option to copy the chart into cache and retain the source data as well using the fol one line

 Me.chtAIRN.Action = acOLECopy

Thankyou both.

Kev
Hi budorat,

If you need to export a chart to file in some common format, you can use the type of code below  provided by Microsoft:

Private Sub Command1_Click()
Dim grpApp As Graph.Chart
Set grpApp = Me.Graph1.Object
grpApp.Export "C:\Graph1.jpg", "JPEG"
Me.Graph1.Locked = False
Me.Graph1.Enabled = True
Set grpApp = Nothing
Me.Graph1.Action = acOLEClose
End Sub

More details here:
http://support.microsoft.com/kb/287022
Avatar of thenelson
thenelson

You're welcome.  Glad to help and thank you very much for the points with "A" grade!

Happy computing!

Nelson