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

Select and Configure COM Port Settings

License

Notifications You must be signed in to change notification settings

Serialcomms/COM-Port-Configuration-VBA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COM Port Configuration in Excel

COM_PORT_CONFIG COM_PROPERTIES

Installing VBA Module

The main VBA module file should be installed first

VBA Module Installation

  • Download COM_PORT_ENUM_SETTINGS.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_SETTINGS.bas

  • Check that a new module COM_PORT_ENUM_SETTINGS is created and visible in the Modules folder

  • VBA6 only - delete PtrSafe keyword in function definition

  • Close and return to Excel (Alt-Q)

  • IMPORTANT - save document as type Macro-Enabled with a file name of your choice

Ribbon Customisation

Ribbon Customisation

Adding custom Ribbon tab

The Office RibbonX Editor is recommended for Ribbon customisation.

Download and install RibbonX following the instructions provided with it.

Download the file RIBBON.xml in preparation for use.

Follow the instructions to install the RIBBON.xml customisation file.

RibbonX Editor Screenshot

Successful Ribbon XML customisation and validation using RibbonX editor

RibbonX

Using Tab Controls

Select COM Port

The text Select Com Port is clickable.

  • Clicking it will perform another com port scan and update the drop-down box below it.
  • Text will change to Detect Com Port if no ports are available.
  • Mouse hovering over it will show a 'Supertip' message with the :-
  1. number of Com ports available
  2. last port scan date and time

Com ports are not opened and do not need to be free during a port scan.

COM Port Drop-Down

  • The drop-down is populated when initially opening the Workbook, or by clicking the button above it.
  • Selecting a drop-down item will refresh the Com Port Settings icon on the right.

COM Port Settings

  • Clicking the icon will start the Windows Com Port Config dialogue window.
  • New settings can be selected in the dialogue window in preparation for change.
  • The selected COM port needs to be opened briefly to apply the changes.
  • A confirmation message box appears prior to opening the port and changing settings.
DLL Errors

DLL Errors may be returned if the port is unavailable or the settings cannot be applied to it.

If COM ports have been added, removed or renumbered, click "Select Com Port" to perform a new port scan.

Note that some port types (e.g. software virtual com ports) may not support any settings changes from default.