安装AR SP4Private Function SaveFile(ByVal strTitle As String, ByVal strFilter As String)
    dlgFile.DialogTitle = strTitle
    dlgFile.Filter = strFilter
    dlgFile.FilterIndex = 1
    dlgFile.ShowSave
    SaveFile = dlgFile.FileName
End FunctionPrivate Sub ExportExcel_Click()
Dim xls As New ActiveReportsExcelExport.ARExportExcel
Dim sFile As String
Dim bSave As Boolean    sFile = SaveFile("保存为Excel", "Excel 格式(*.xls)|*.xls|")
    xls.FileName = sFile
    If arvReport.Pages.Count > 0 Then
        xls.Export arvReport.Pages
    ElseIf Not arvReport.ReportSource Is Nothing Then
        If arvReport.ReportSource.Pages.Count > 0 Then
            xls.Export arvReport.ReportSource.Pages
        End If
    End If
    Set xls = NothingEnd Sub