VBA Module Installation
-
Download COM_PORT_ENUM_RIBBON.bas to a known location on your PC
-
Open a new Excel document
-
Enter the VBA Environment (Alt-F11)
-
From VBA Environment, view the Project Explorer (Control-R)
-
From Project Explorer, right-hand click and select Import File
-
Import the file COM_PORT_ENUM_RIBBON.bas
-
Check that a new module
COM_PORT_ENUM_RIBBONis created and visible in the Modules folder -
VBA6 only - delete
PtrSafekeyword in function definition -
Close and return to Excel (Alt-Q)
-
IMPORTANT - save document as type Macro-Enabled with a file name of your choice
Combo Box and Formula Testing
Open the document in Excel and check that no error messages appear on startup.
Select the COM Port tab and check that a combo box with a label above it is present
Enter the formula =Read_Ribbon_Combo() in any cell to begin
Select a testing scenario below based on the number of COM ports known to be available on the PC.
No COM Ports
Check that -
- Label above combo box is Detect COM Ports
- Hovering over label shows supertip message 'No COM Ports available'
- Combo box shows message No COM Ports
- Cell with
=Read_Ribbon_Combo()is blank
Single COM Port
Check that -
- Label above combo box is Select COM Port
- Hovering over label shows supertip message 'COM Ports available = 1'
- Single Com Port is available for selection in Combo box
- Selecting the Com port shown updates cell with formula
=Read_Ribbon_Combo()result - Clicking Select COM Port clears combo box and cell
Multiple COM Ports
Check that -
- Label above combo box is Select COM Port
- Hovering over label shows supertip message 'COM Ports available = n'
- Multiple Com Ports are available for selection in Combo box
- Selecting a Com port updates cell with formula
=Read_Ribbon_Combo()result - Selecting a different Com port updates cell with new Com port
- Clicking Select COM Port clears combo box and cell
Adding / Removing COM Ports
If possible, check that adding and removing COM Ports updates the worksheet and controls correctly
Click the label above the combo box, or re-select the combo box to re-scan available ports.
Check that the following items change as expected -
- Label above Combo Box
- Label Supertip message
- Combo box entries
- Formula cell