Question Export a Chart (form) , Repost

Zorkmid

Registered User.
Local time
Yesterday, 21:55
Joined
Mar 3, 2009
Messages
188
Sorry to repost, but Im not sure where it belongs.

Hi there,

I have a form that filters a subform based on a query. The subform's default view is pivot table and allows me to produce charts that I want to export as picture files and eventually add into .ppt presentations.

I get a type Mismatch error when I hit my export button and I'm not quite sure how to solve it.

Code:
Private Sub Export_Click()
Dim frm As Form
Dim strForm As String
Dim strFile As String
Dim strDir As String
    strDir = "G:\Admin\Ceo\Human Resources\RISKMGMT\Inhouse data\Risk Database\Source Files\Charts\"
        strForm = Me.Reports_by_type.Form
        strFile = "ReportsoverTime" & ".gif"
'       DoCmd.OpenForm strForm, acFormPivotChart
        Set frm = Me.Reports_by_type.Form
        Set cht = frm.ChartSpace
        cht.ExportPicture strDir & strFile, , 1024, 720
  '      DoCmd.Close acForm, strForm
 
    If MsgBox("Your Graph has been exported ", vbOK) = vbOK Then
        End If
 
End Sub

Any ideas?
 

Users who are viewing this thread

Back
Top Bottom