AutoCAD 2005 Type Library Problem

Discussion in 'AutoCAD' started by WalterS, May 6, 2004.

  1. WalterS

    WalterS Guest

    I have a VBA routine that works great under 2000i and 2004 but fails under 2005. I have traced the problem to the AutoCAD 2005 type library.

    I get a "Can't compile module" error with the snipit of code below. lyrObj is highlighted when I select debug.
    Dim lyrObj As AcadLayer
    Set lyrObj = "SomeLayer"

    This runs fine under 2004 but fails only after I install 2005. It appears that the acax16enu.tlb file is different. I can copy back the older file but will that cause any problems with 2005???

    Thanks for any advice you can give,
    Walter S.
     
    WalterS, May 6, 2004
    #1
  2. Dim lyrObj As AcadLayer
    Number 1, DO NOT copy back the old library! Second, this should bomb in
    2004 as well [2000i was half-baked so I can see it working]. Look at what
    you have....lyrObj is dimmed as a layer object so you cannot set it to a
    string value - you have to use a Layer Object or parse thru the layer
    collection looking for "SomeLayer". Go back ttoo 2004 and include Option
    Explicit at the top of your code and/or remove any On Error Resume Next and
    it should not function there either.
     
    Mike Tuersley, May 6, 2004
    #2
  3. WalterS

    WalterS Guest

    Solution (sort of...)
    Well I don't know if my solution was right but I got AutoCAD 2005, 2004 and 2000i to play nicely on the same machine. I uninstalled and reinstalled 2004 after installing 2005. That cleared up the problems I was having and all appear to be working well together.
     
    WalterS, May 10, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.