Create a Visio flowchart from Excel table

Started by FryGirl, March 19, 2021, 04:19:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FryGirl

Hi Surrogate,

Yes, I added the reference to the library in the VBE.  Wasn't sure which to use, so I checked all three.  Type Library, Save As Web Type Library, and Visio Viewer 16.0 Type Library.

How can the code be changed to late binding?

Surrogate

#16
Quote from: FryGirl on March 20, 2021, 10:16:16 PM
Wasn't sure which to use, so I checked all three.  Type Library, Save As Web Type Library, and Visio Viewer 16.0 Type Library.
Just cant find all these libraries as loaded (checked)

I use Visio 2019 Professional ie Visio 16 Type Library, like as MS Visio 2016.
Quote from: FryGirl on March 20, 2021, 10:16:16 PM
How can the code be changed to late binding?
if you use late binding, you dont need add references, but you need use values instead Visio's application system constants
    AppVisio.Documents.AddEx "", 0, 0
    AppVisio.Documents.OpenEx "C:\Users\1212C\Documents\My Shapes\Fry.vssx", 0 + 4  'Add Basic Stencil

https://docs.microsoft.com/en-us/office/vba/api/visio.vismeasurementsystem
https://docs.microsoft.com/en-us/office/vba/api/visio.documents.openex

FryGirl

Hi Surrogate,

That worked great by updating to the constants.  Thanks.

Croc

FryGirl, If you insert the following lines at the end of the DropStringOfBoxes procedure, then Visio will make the flowchart beautiful :)
   ...
    AppVisio.ActiveWindow.DeselectAll
    AppVisio.ActivePage.PageSheet.Cells("PlaceStyle").FormulaForceU = "1"
    AppVisio.ActivePage.PageSheet.Cells("RouteStyle").FormulaForceU = "5"
    AppVisio.ActivePage.Layout
   
    Set AppVisio = Nothing
End Sub

FryGirl

Wow, thanks Croc.  More than I could have expected.

Appreciate all the time and help from everybody.