1' *************************************************************
2'
3'  Licensed to the Apache Software Foundation (ASF) under one
4'  or more contributor license agreements.  See the NOTICE file
5'  distributed with this work for additional information
6'  regarding copyright ownership.  The ASF licenses this file
7'  to you under the Apache License, Version 2.0 (the
8'  "License")' you may not use this file except in compliance
9'  with the License.  You may obtain a copy of the License at
10'
11'    http://www.apache.org/licenses/LICENSE-2.0
12'
13'  Unless required by applicable law or agreed to in writing,
14'  software distributed under the License is distributed on an
15'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16'  KIND, either express or implied.  See the License for the
17'  specific language governing permissions and limitations
18'  under the License.
19'
20' *************************************************************
21VERSION 5.00
22Begin {AC0714F6-3D04-11D1-AE7D-00A0C90F26F4} Wizard
23   ClientHeight    =   7470
24   ClientLeft      =   1740
25   ClientTop       =   1545
26   ClientWidth     =   6585
27   _ExtentX        =   11615
28   _ExtentY        =   13176
29   _Version        =   393216
30   DisplayName     =   "AnalysisWizard"
31   AppName         =   "Visual Basic"
32   AppVer          =   "Visual Basic 6.0"
33   LoadName        =   "Command Line / Startup"
34   LoadBehavior    =   5
35   RegLocation     =   "HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0"
36   CmdLineSupport  =   -1  'True
37End
38Attribute VB_Name = "Wizard"
39Attribute VB_GlobalNameSpace = False
40Attribute VB_Creatable = True
41Attribute VB_PredeclaredId = False
42Attribute VB_Exposed = False
43Option Explicit
44
45Dim mcbMenuCommandBar         As Office.CommandBarControl  'command bar object
46Public WithEvents MenuHandler As CommandBarEvents          'command bar event handler
47Attribute MenuHandler.VB_VarHelpID = -1
48Dim mfrmWizard As frmWizard
49Dim VBInstance As VBIDE.VBE
50
51
52'------------------------------------------------------
53'this method adds the Add-In to the VB menu
54'it is called by the VB addin manager
55'------------------------------------------------------
56Private Sub AddinInstance_OnConnection(ByVal application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
57   On Error GoTo error_handler
58
59   Set VBInstance = application
60
61   If ConnectMode = ext_cm_External Then
62       'Used by the wizard toolbar to start this wizard
63       LoadMe
64   Else
65       Set mcbMenuCommandBar = AddToAddInCommandBar(VBInstance, LoadResString(15), LoadResPicture(5000, 0))
66       'sink the event
67       Set Me.MenuHandler = VBInstance.Events.CommandBarEvents(mcbMenuCommandBar)
68   End If
69
70   Exit Sub
71
72error_handler:
73   MsgBox Err.Description
74End Sub
75
76'------------------------------------------------------
77'this method removes the Add-In from the VB menu
78'it is called by the VB addin manager
79'------------------------------------------------------
80Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
81    'delete the command bar entry
82    mcbMenuCommandBar.Delete
83End Sub
84
85'this event fires when the menu is clicked in the IDE
86Private Sub MenuHandler_Click(ByVal CommandBarControl As Object, handled As Boolean, CancelDefault As Boolean)
87    LoadMe
88End Sub
89
90Private Sub LoadMe()
91    Set mfrmWizard = New frmWizard
92    'pass the vb instance to the wizard module
93    Set mfrmWizard.VBInst = VBInstance
94    'load and show the form
95    mfrmWizard.Show vbModal
96    Set mfrmWizard = Nothing
97End Sub
98
99
100