Author Topic: Create a Visio flowchart from Excel table  (Read 12072 times)

0 Members and 1 Guest are viewing this topic.

FryGirl

  • Jr. Member
  • **
  • Posts: 13
Re: Create a Visio flowchart from Excel table
« Reply #15 on: March 20, 2021, 05:16:16 PM »
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

  • Hero Member
  • *****
  • Posts: 1350
    • ShapeSheet™ Knowledge Base
Re: Create a Visio flowchart from Excel table
« Reply #16 on: March 20, 2021, 05:32:31 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.
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
Code
    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
« Last Edit: March 20, 2021, 05:37:09 PM by Surrogate »

FryGirl

  • Jr. Member
  • **
  • Posts: 13
Re: Create a Visio flowchart from Excel table
« Reply #17 on: March 20, 2021, 06:04:09 PM »
Hi Surrogate,

That worked great by updating to the constants.  Thanks.

Croc

  • Sr. Member
  • ****
  • Posts: 280
    • Visioport
Re: Create a Visio flowchart from Excel table
« Reply #18 on: March 21, 2021, 02:15:00 AM »
FryGirl, If you insert the following lines at the end of the DropStringOfBoxes procedure, then Visio will make the flowchart beautiful :)
Code
   ...
    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

  • Jr. Member
  • **
  • Posts: 13
Re: Create a Visio flowchart from Excel table
« Reply #19 on: March 21, 2021, 07:50:56 AM »
Wow, thanks Croc.  More than I could have expected.

Appreciate all the time and help from everybody.