| VBA Function | Description |
|---|---|
query_com_ports() |
Returns number of COM ports, updates Public Variables shown in table below |
create_combo() |
Checks if port selector Combo box exists in Workbook Sheet1 and creates if missing |
create_combo(sheet_name) |
Checks if port selector Combo box exists in specified sheet and creates if missing |
read_combo() |
Returns COM port selected from combo box in Workbook Sheet1 1 |
read_combo(sheet_name) |
Returns COM port selected from combo box in specified sheet 1 |
read_ribbon_combo() |
Returns COM port selected from combo box in customised Excel Ribbon |
| Variable Name | Variable Type | Description |
|---|---|---|
Com_Port_Count |
Long | Number of Com ports returned by getcommports 2 |
Com_Port_Names() |
String Array | Names of Com ports as text "COM" suffixed by Com Port Number |
Com_Port_Numbers() |
Long Array | Com port numbers returned by getcommports 2 |
Com_Port_Selected |
String | Com port name selected in combo box, or 'no ports found' text |
Notes
- Worksheet VBA required in file
Sheet1.basto refresh combobox contents list. - Further development required to use with Excel and other Office applications.
- Files in Minimal folder for use with Access and other Office applications.
Footnotes
-
Primarily for use within VBA, can also configure combo with
LinkedCellto update defined worksheet cell directly with port selection. ↩ ↩2 -
See
getcommportsdocumentation for details of Win32 API function used. ↩ ↩2