Author Topic: Compile Error: User not not defined. Macro is not working in Visio 2013  (Read 5280 times)

0 Members and 1 Guest are viewing this topic.

oceangoing

  • Newbie
  • *
  • Posts: 1
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!!!


AndyW

  • Sr. Member
  • ****
  • Posts: 326
    • PC Mimic Diagram
You just need to add the reference

'Microsoft Visual Basic for Applications Extensibility 5.3'
Live life with an open mind