Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 2.62 KB

README.md

File metadata and controls

37 lines (25 loc) · 2.62 KB

VBAChromeDevProtocol

VBA (Excel) based wrapper for Chrome Developer Protocol (CDP) - sorta a VBA version of Puppeteer/Selenium

Note: if you can use Puppeteer, Playright, Selenium, or some other tool - then use it! But if you can only use VBA, then this is meant to provide a means to automate Chrome or Edge based browsers. (Possibly Firefox via its limited CDP support, though currently untested/nonfunctional).

See https://chromedevtools.github.io/devtools-protocol/ for overview of Chrome Devloper Protocol

Initial work based on information and clsEdge from https://www.codeproject.com/Tips/5307593/Automate-Chrome-Edge-using-VBA

Primarily connects directly to browser using Chrome/Edge's ability to use the CDP via pipes when started, however, now also has basic support for connecting to browser through standard websocket interface so can reuse already open browser if started with CDP port 9222 listening.

Currently primarily tested with and assumes working with Edge; however will detect and support spawning Chrome and possibly FireFox (Chrome should work at least in websocket mode, Firefox is untested)

TODO

  • improve/add usage documentation
  • generator needs some more work (still has some class names too long/clash, still has some clashes with reserved words, incorrectly assumes class for unspecified object)

Note

when downloading the source files from git, be sure to convert to DOS/Windows CRLF style endings for the text files or Office may import as wrong module type (regular modules instead of class modules) - to be updated to ensure git always does this

Usage

see Example.xlsm - documentation to be added

Special thanks / uses source based on

Testing and enhancements by Jason Pullen and Kenneth J. Davis