Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Latest commit

 

History

History
26 lines (22 loc) · 2.67 KB

File metadata and controls

26 lines (22 loc) · 2.67 KB

VBA Functions

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

Public Variables

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

  1. Worksheet VBA required in file Sheet1.bas to refresh combobox contents list.
  2. Further development required to use with Excel and other Office applications.
  3. Files in Minimal folder for use with Access and other Office applications.

Footnotes

  1. Primarily for use within VBA, can also configure combo with LinkedCell to update defined worksheet cell directly with port selection. 2

  2. See getcommports documentation for details of Win32 API function used. 2