2 Begin {AC0714F6-3D04-11D1-AE7D-00A0C90F26F4} Wizard
\r
10 DisplayName = "AnalysisWizard"
\r
11 AppName = "Visual Basic"
\r
12 AppVer = "Visual Basic 6.0"
\r
13 LoadName = "Command Line / Startup"
\r
15 RegLocation = "HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0"
\r
16 CmdLineSupport = -1 'True
\r
18 Attribute VB_Name = "Wizard"
\r
19 Attribute VB_GlobalNameSpace = False
\r
20 Attribute VB_Creatable = True
\r
21 Attribute VB_PredeclaredId = False
\r
22 Attribute VB_Exposed = False
\r
25 Dim mcbMenuCommandBar As Office.CommandBarControl 'command bar object
\r
26 Public WithEvents MenuHandler As CommandBarEvents 'command bar event handler
\r
27 Attribute MenuHandler.VB_VarHelpID = -1
\r
28 Dim mfrmWizard As frmWizard
\r
29 Dim VBInstance As VBIDE.VBE
\r
32 '------------------------------------------------------
\r
33 'this method adds the Add-In to the VB menu
\r
34 'it is called by the VB addin manager
\r
35 '------------------------------------------------------
\r
36 Private Sub AddinInstance_OnConnection(ByVal application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
\r
37 On Error GoTo error_handler
\r
39 Set VBInstance = application
\r
41 If ConnectMode = ext_cm_External Then
\r
42 'Used by the wizard toolbar to start this wizard
\r
45 Set mcbMenuCommandBar = AddToAddInCommandBar(VBInstance, LoadResString(15), LoadResPicture(5000, 0))
\r
47 Set Me.MenuHandler = VBInstance.Events.CommandBarEvents(mcbMenuCommandBar)
\r
53 MsgBox Err.Description
\r
56 '------------------------------------------------------
\r
57 'this method removes the Add-In from the VB menu
\r
58 'it is called by the VB addin manager
\r
59 '------------------------------------------------------
\r
60 Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
\r
61 'delete the command bar entry
\r
62 mcbMenuCommandBar.Delete
\r
65 'this event fires when the menu is clicked in the IDE
\r
66 Private Sub MenuHandler_Click(ByVal CommandBarControl As Object, handled As Boolean, CancelDefault As Boolean)
\r
70 Private Sub LoadMe()
\r
71 Set mfrmWizard = New frmWizard
\r
72 'pass the vb instance to the wizard module
\r
73 Set mfrmWizard.VBInst = VBInstance
\r
74 'load and show the form
\r
75 mfrmWizard.Show vbModal
\r
76 Set mfrmWizard = Nothing
\r