PLEASE HELP! Exporting Access objects!

Rehan

New member
Local time
Today, 12:25
Joined
Oct 12, 2006
Messages
4
Hi guys,

I want to export a couple of graphs to a single excel file. The graphs are
made in Microsoft Graphs 2000. Can this be done using VBA code. If yes, can
you explian how?

-The graphs are Microsoft Graph Object.
-Embedded in a Access sub-form.

This is my code to export the graphs to a folder called 3PP Exported Charts. Then i plan to use an Excel Macro and move the graphs to an Excel file.

Code:
Private Sub Export_Click()

Dim graphExport As Object
Dim vendor as string

vendor = cmbVendor.Value 'Gets the selected name of the vendor from the combo box

Set graphExport = Me.Ctl3PPContractChart.Object
graphExport.Export "C:\3PP Exported Charts\" & vendor & ".jpg", "JPEG"
Set graphExport = Nothing
Me.Ctl3PPContractChart.Action = acOLEClose

End Sub

The Unbound Object Frame which contains the graphs has properties Enabled set to No and locked set to Yes. Previously, when they had their default values (i.e. Enabled=Yes, Locked=No), and i click the Export button, the graphs would mess up i.e. font changed, size changed, overall orientation changed. But after i set these porperties the graphs come out fine. But then i get the error that you have to re-install the OLE server and the Database crashes.

Please guy, can you help me do this?


PS: If there are anymore questions on this issue, i will be glad to answer.
 
Last edited:
Don't know whether it will help, but there was an extensive post on Graphs in access a while back so I suggest you use a search facility and have a look.
 
Tks for the adivce.

I found a couple of posts but they donot relate to my problem.

My problem is that when i click this export button, the error says the action you tried on the object failed.

I think it refers to the Me.Ctl3PPContractChart.Action command.

Can somebody please help!
 
Tks for the adivce.

I found a couple of posts but they donot relate to my problem.

My problem is that when i click this export button, the error says the action you tried on the object failed.

I think it refers to the Me.Ctl3PPContractChart.Action command.

Can somebody please help!
 
sorry...dont know what happened...dint mean to post that many :)
 
I realise this was 2 years ago...lol...but i just had the same problem and fixed it.

the answer to this problem is:

change the properties of the chart to enabled = yes, locked = yes

done
 

Users who are viewing this thread

Back
Top Bottom