Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: [DR] M@ck [NL] on July 06, 2015, 03:05:16 PM

Title: Combining two Shape Data Rows into one (1) new, results in multiple lines
Post by: [DR] M@ck [NL] on July 06, 2015, 03:05:16 PM
Dear all,

Thanks for this great forum, it already helped me with multiple visio questions. After mastering Excel, visio is now on my list.
I have an issue, that is probably only a minor setting, but it is been bugging me for hours, so time to ask the experts.


I have made a Swimlane Stencil in which my Shape shows both the Row (Prop.Function)  and Column (Prop.Row_2 = Phase).
Prop.Function.Value =IFERROR(CONTAINERSHEETREF(1,"Swimlane")!User.VISHEADINGTEXT,"")
Prop.Row_2.Value =IFERROR(CONTAINERSHEETREF(1,"Phase")!User.VISHEADINGTEXT,"")


Now I have made an aditional User Property:
Prop.Row_9.Value = Prop.Function&Prop.Row_2                 

My problem here is that in the shape data it nicely shows (for example): A1     [A=Prop.Function & 1=Prop.Row_2]
But if i click on it in the shape data or make a Excel Report it is shown as:
A
1

(So there seems to be a hard ENTER between the two)

No I cant find an option such as CONCATENATE in Excel.

I hope there is someone that can help me out.

Title: Re: Combining two Shape Data Rows into one (1) new, results in multiple lines
Post by: JuneTheSecond on July 07, 2015, 07:24:08 AM
Visio shape sheet is something special.
I hope next macro may be some reference.

Option Explicit



Option Explicit

Sub test()
    Dim shp As Visio.Shape
    Dim txt1 As String, txt2 As String
    Set shp = ActivePage.Shapes(1)
    shp.Cells("Prop.test1").Formula = """A"""
    shp.Cells("Prop.test2").Formula = """3"""
    txt1 = shp.Cells("Prop.test1").ResultStr("")
    txt2 = shp.Cells("Prop.test2").ResultStr("")
    Debug.Print txt1 & txt2
End Sub