Micron,
Have you got some code you could share?
I haven't done much of this an haven't found good tutorial etc.
I used Tom's code, changed to funtion, when I got the Run Tests window it will attach to the vbe header info.
I can't get it to execute Tom's function/sub, nor 1 of my own. I can't rerun the commandbar create stuff a second time -- I get invalid procedure call -- and can't find a way to Delete the commandbar.
I can run this
Code:
Function listcommandbars()
Dim ibar As Integer
For ibar = 1 To Application.VBE.CommandBars.Count
Debug.Print ibar; Application.VBE.CommandBars(ibar).Name
Next ibar
End Function
and can see the Run Tests # 33
Code:
1 Menu Bar
2 Standard
3 Edit
4 Debug
5 UserForm
6 Document
7 Code Window
8 Toggle
9 Project Window Insert
10 Code Window (Break)
11 Watch Window
12 Immediate Window
13 Locals Window
14 Project Window
15 Project Window (Break)
16 Object Browser
17 MSForms
18 MSForms Control
19 MSForms Control Group
20 MSForms Palette
21 MSForms Toolbox
22 MSForms MPC
23 MSForms DragDrop
24 Toolbox
25 Toolbox Group
26 Property Browser
27 Property Browser
28 Docked Window
29 Clipboard
30 System
31 MZ-Tools 8.0 - Main
32 MZ-Tools 8.0 - Other Utilities
33 Run Tests
Update:
I can delete the "Run Tests" custom commandbar in VBE with the following
Code:
' ----------------------------------------------------------------
' Procedure Name: delcmdbar
' Purpose: To delete a VBE Command bar
' Procedure Kind: Function
' Procedure Access: Public
' Author: Jack
' Date: 28-Dec-19
' ----------------------------------------------------------------
Function delcmdbar()
Dim delbars As Integer
Dim bar As CommandBar
10 For Each bar In Application.VBE.CommandBars
20 If (bar.BuiltIn = False) And _
(bar.Name = "Run Tests") Then
30 bar.Delete
40 delbars = delbars + 1
50 Else
60 Debug.Print bar.Name
70 End If
80 Next bar
90 Debug.Print vbNewLine & "VBE command bars deleted : " & delbars
End Function