Create Visio flowchart diagram from Excel Row Data

muthus80

New Member
Joined
Jun 28, 2015
Messages
4
Hello,

Need the assistance on the following Excel requirement.

We will need to convert excel Row data into Visio Flowchart using VBA macro.

1. Each row in Excel need to be converted into Rectangle Shape in Visio diagram. At this time fine with only one shape but later based on row data we have to decide the shapes (like decision..etc)at run time. All the shapes need to be connected in the same visio drawing.
2. There is no limit in number of rows in excel and the entire row need to be converted into a single shape.
3. The row data will be in a single column of that row.

Example in Excel 4 rows of data like below:
Row 1: Login as guest user
Row 2: Provide the search creteria
Row 3: View the results.
Row 4: Logout.

The above has to be converted into 4 rectangle shapes and connected as a flowchart.

Please help me to write vba macro on this.

Thanks in advance.

Muthu.
 
Last edited:
Hi Plhil,

I too have same ind of reqirement.. wth above code getting error the below code .
Code:
  AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lShapeID).AddRow 242, 0, 0 'visSectionUser, 0, visTagDefault
    AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lShapeID).CellsSRC(242, 3, 0).RowNameU = "TextHeight" 'visSectionUser, 3, visUserValue
    AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lShapeID).CellsSRC(242, 3, 0).FormulaU = "TEXTHEIGHT(TheText,width)" 'visSectionUser, 3, visUserValue
    
    'If the text box is taller than the shape height, reduce text font size by .5 pt until it is smaller or font size = 8 pt
    sngTextHeight = AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lShapeID).CellsSRC(242, 3, 0) 'visSectionUser, 3, visUserValue
    Do While sngTextHeight > vShapeheight And sngFontDefaultSize > sngFontMinimumSize
        sngFontDefaultSize = sngFontDefaultSize - 0.5
        sngTextHeight = AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lShapeID).CellsSRC(242, 3, 0)  'visSectionUser, 3, visUserValue
        AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lShapeID).CellsSRC(3, 0, 7).FormulaU = sngFontDefaultSize & " pt"
    Loop
    'AppVisio.ActiveWindow.Close 'Close Shape ShapeSheet
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,216,167
Messages
6,129,262
Members
449,497
Latest member
The Wamp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top