I am working on my diploma work. The goal is to create addin in visio that should be able to load data from access and vizualize them. I am working in visual studio 2010.
I have problem with one sub (the most important), which should take data from visio.datarecordset a draw them on active page.
i tried do it this way Page.DropManyLinkedU Method (Visio)
My version looks like this:
but it doesnt work. Error looks like:
IvalidCastException was unhandled by user code
Unable to cast COM object of type 'Microsoft.Office.Interop.Visio.MasterClass' to class type 'System.Array'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
version with DropLinked works fine, but i like to use DropManyLinkedU.
What am i doing wrong?:/ what that error mean?
There is some conversion problem...or what
I have problem with one sub (the most important), which should take data from visio.datarecordset a draw them on active page.
i tried do it this way Page.DropManyLinkedU Method (Visio)
My version looks like this:
VB.NET:
Private Sub DrawDataset()
Dim avarObjects(0 To 2) As Object
Dim adblXYs(0 To 5) As Double
Dim alngDataRowIDs(0 To 2) As Long
Dim alngShapeIDs() As Long
Dim vsoDataRecordset As Visio.DataRecordset
Dim intRecordesetCount As Integer
Dim lngReturned As Long
Dim intCounter As Integer
intRecordesetCount = pjVis.Application.ActiveDocument.DataRecordsets.Count
vsoDataRecordset = pjVis.Application.ActiveDocument.DataRecordsets(intRecordesetCount)
adblXYs(0) = 2
adblXYs(1) = 2
adblXYs(2) = 4
adblXYs(3) = 4
adblXYs(4) = 6
adblXYs(5) = 6
alngDataRowIDs(0) = 1
alngDataRowIDs(1) = 2
alngDataRowIDs(2) = 3
pjVis.Application.ActivePage.DropManyLinkedU(ObjectsToInstance:=appVis.Documents("BASIC_M.VSS").Masters.ItemU("Rectangle"), XYs:=adblXYs, DataRecordsetID:=1, DataRowIDs:=alngDataRowIDs, ApplyDataGraphicAfterLink:=False, ShapeIDs:=alngShapeIDs)
End Sub
IvalidCastException was unhandled by user code
Unable to cast COM object of type 'Microsoft.Office.Interop.Visio.MasterClass' to class type 'System.Array'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
version with DropLinked works fine, but i like to use DropManyLinkedU.
What am i doing wrong?:/ what that error mean?
There is some conversion problem...or what