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.
Any ideas?
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?