Hi All,
Much appreciated if you can help me to solve this problem.
I have some macros working Visio 2010 are fine. Recently, we decide to move our Visio 2010 to Visio 2013. I have tried many methods to clean up but still have the following macros can not be recoganized.
For example, the following macro is still showing me "Compile Error: User-defined type is not defined". I have tried all possible libry like, DAO 3.6, ActiveX Data 6.1 object library and so on.
Function vbCompExists(objVBProject As VBIDE.VBProject, strCompName As Variant)
vbCompExists = 0
For x = 1 To objVBProject.VBComponents.count
If objVBProject.VBComponents.Item(x).name = strCompName Then
vbCompExists = x
Exit Function
End If
Next
End Function
The Visio 2013 is still not working with Macros.
Please help!!!
Did you try this?
https://social.msdn.microsoft.com/Forums/office/en-US/1f8d4fc9-d5a5-433d-bf07-92ca493f01d4/programmatically-adding-references-vbide-is-not-recognized?forum=exceldev
You just need to add the reference
'Microsoft Visual Basic for Applications Extensibility 5.3'