Share this Page URL

Chapter 11. Extending Office Data Analys... > Extending the Data Analysis Features... - Pg. 237

Extending Office Data Analysis Features with Code 237 Extending the Data Analysis Features in Microsoft Data Analyzer Microsoft Data Analyzer does not include the Visual Basic Editor that comes with most other Office applications. To program Data Analyzer, you must embed an instance of the Data Analyzer ActiveX control in an instance of a VBA UserForm, a 32-bit Windows form such as a Visual Basic or Microsoft Visual C++ form, or a Web page. You then write code using the hosting application's corresponding programming language. In the following code sample, included in the Chap11 folder's DACode.xls file, a VBA UserForm inside an Excel workbook hosts an instance of the Data Analyzer ActiveX control. Note You must have Microsoft Data Analyzer and Microsoft SQL Server 2000 Analysis Services installed on your computer to run the following code sample. For complete information about programming the Data Analyzer ActiveX control, see the Microsoft Data Analyzer API help file included with Data Analyzer or the Microsoft Developer Network (MSDN) Web site at Here's the code: Private Sub Workbook_Open() ' Open the frmDA VBA UserForm. frmDA.Show End Sub The Workbook object's Open event opens the VBA UserForm, referred to as frmDA in the code. The form contains an instance of the Data Analyzer ActiveX control.