Exporting ShapeSheet Data To Excel

Started by OldSchool1948, December 18, 2018, 10:53:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OldSchool1948

I have a routine that loops through and exports shape sheet visSectionProp data to Excel.  I've tried using a similar function to export visSectionAction data to Excel, however, everything exports but the Action column, which always returns "0.0000"

Below is a rought outline of the code:


Dim vsoSelection as Visio.Selection
Dim vsoShape as Visio.Shape
Dim vsoCell as Visio.Cell
Dim iRow as Integer
Dim j as Integer
Dim i as Integer
Dim nRow as Integer
Dim rowName as String

Set vsoSelection = Visio.ActiveWindow.Selection

For i = 1 to vsoSelection.Count

    Set vsoShape = vsoSelection(i)

    nRows = vsoShape.RowCount(Visio.visSectionAction)

    For j = 0 to nRows - 1

        '// Get and Cleanup the Row Name
         Set vsoCell = vsoShape.CellsSRC(Visio.visSectionAction, j, visActionAction)
         rowName = Replace(vsoCell.Name, "Actions.", "")
         rowName = Replace(rowName, ".Action","")         

         '// Get the Row ID
         iRow = vsoShape(CellsRowIndex("Actions." & RowName)

         Set vsoCell = vsoShape.CellsSrc(Visio.visSectionAction, iRow, visActionAction)

         '// strAction always contains 0.0000
         Dim strAction as String
         strAction = vsoCell.ResultStr(Visio.visNone)

        '// The below code works.
        Dim Menu as String
        Set vsoCell = vsoShape.CellsSrc(Visio.visSectionAction, iRow, visActionMenu)
        Menuu = vsoCell.ResultStr(Visio.visNone)

       ' As does similar code that I use for visActionButtonFace, visActionReadOnly, and visActionFlyoutChild

      '// Write data to Excel
      xlSheet.Cells(nextRow, 1) = RowName
      xlSheet.Cells(nextRow, 2) = strAction

      nextRow = nextRow + 1

      ' Etc, etc,

    Next j

Next I


Any suggestions would be appreciated.


Surrogate

Try change this row
strAction = vsoCell.Formula
When you open ShapeSheet window, and use cells view as Values you can see in Action column zero

OldSchool1948

Duh!!  :o  Worked like a charm.  Thanks!!