Visio External Data

Started by BWEB, January 08, 2016, 02:34:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BWEB

I have a Visio diagram that contains external data and I need to extract the external data into excel.. 

Help

Yacine

Hi,
the easiest way, would be to use a report.
For more sophisticated stuff you can write a macro.
Regards,
Y.
Yacine

BWEB

I am new so I might be wrong but when I tried to do a report it shows me only the data that was linked to shapes.. I want all of the external data..  Think I need to write a macro but don't know how to ever start that so any help (detailed) would be helpful.

Found this on the web..  but how do I get it into Visio, run it and change the code to output the data to a text file...

***
Public Sub GetDataRecords(vsoDataRecordset As Visio.DataRecordset)

    Dim lngRowIDs() As Long
    Dim lngRow As Long
    Dim lngColumn As Long
    Dim varRowData As Variant

    'Get the row IDs of all the rows in the recordset
    lngRowIDs = vsoDataRecordset.GetDataRowIDs("")

    'Iterate through all the records in the recordset.
    For lngRow = LBound(lngRowIDs) To UBound(lngRowIDs)
        varRowData = vsoDataRecordset.GetRowData(lngRow)

        'Print a separator between rows
        Debug.Print "------------------------------"

       'Print the data stored in each column of a particular data row.
        For lngColumn = LBound(varRowData) To UBound(varRowData)
            Debug.Print vsoDataRecordset.DataColumns(lngColumn + 1) .Name _
               & Trim(Str(lngColumn)) & " = " VarRowData(lngColumn)
        Next lngColumn
    Next lngRow

End Sub

Yacine

The external data are obviously external ;D.
Can't you get the file?
Yacine

Nikolay

#4
Did you have a chance to look at the Report Wizard Yacine adviced?
Here is a nice video explaining what it is and how to use it:

Getting Started with Visio - Build and Apply Reports from Share Data

If you need to extract data not from shapes, but directly from the underlying data recordset which was initally imported into Visio (you seem to sound like that - but that's definitely not a common case), then, well, you also can do that. But in this case, wouldn't it be easier just to go to the original data source to get the data from there?!