export chart OLE server error

H

Heather Vernon

I am trying to export a chart in my form as a GIF. The chart successfully
exports. However, when I try to close my form, I get the following error,
which ultimately crashes Access 2003:

The operation on the Chart object failed.
The OLE server may not be registered.
To register the OLE server, reinstall it.

I tried following the directions on
http://support.microsoft.com/kb/824276/en-us, but when the line
Me.grpData.Action = acOLEClose
is executed, I get this error:

Run-time error '2793'
Microsoft Access can't perform the operation specified in the Action
property of the Visual Basic procedure you're trying to run.

Any help would be appreciated. My subroutine is as follows:

Private Sub cmdExportGif_Click()
Dim objChart As Graph.Chart
Dim dlgSave As Office.FileDialog
Dim strFilename As String

'get filename from user
Set dlgSave = Application.FileDialog(msoFileDialogSaveAs)
With dlgSave
.AllowMultiSelect = False
.Title = "Export Chart As..."
If .Show = True Then
strFilename = .SelectedItems(1)
Else
MsgBox "You canceled the export.", vbOKOnly
Exit Sub
End If
End With

'save file
Set objChart = grpData.Object
objChart.Export strFilename, filtername:="GIF"
Set objChart = Nothing
Me.grpData.Action = acOLEClose
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top