Looking for an example to generate shapes and connect them programatically

Started by PF4VisioGuy, February 15, 2017, 04:27:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PF4VisioGuy

I have pairs of values and I need to connect them together. Imagine numbers in circles that will be connected to each other via straight lines , the numbers indicate the steps of a process.

I would like to read documentation or see examples  for this
Importing all the data from an excel table is fine

wapperdude

The attached example has two macros.  One shows how to grab a range of cells, could be just two cells, and place them on a Visio drawing page.  The code, MyMac, asks for an Excel file, which can be found by normal tree search method.  Then, opens the file and asks for a range of cells.  Each cell is sequentially placed and formatted onto the Visio page.

The 2nd macro is hard coded to drop a connector and glue it to two shapes. 

I think both of these macros are reasonably straight forward and can be easily adapted for your needs.

Enjoy.
Wapperdude
Visio 2019 Pro


wapperdude

Guess I should have asked, what version of Visio?


Wapperdude
Visio 2019 Pro

wapperdude

I reworked the MyMac code to automatically minimize, maximize the Excel window.  It tends to get in the way. 

In addition, I changed the Excel retrieval process.  Now it takes the cells, 2 by 2, and calls the add connector to "link" them together.

Wapperdude
Visio 2019 Pro