ADT2004 and 2005 VBA conflict?

Discussion in 'AutoCAD' started by terencechatfielduk, Sep 16, 2004.

  1. My office is in the process of starting to migrate to 2005 from 2004, and I'm finding some errors occuring that defy explanation. A code statement that has worked fine in 2004, after installation of 2005 starts playing up. An example is a line of code like this:

    Public Sub ChangeProfile()
    Dim preferences As AcadPreferences
    Set preferences = ThisDrawing.Application.preferences
    ' Change to a vaild Profile name
    preferences.Profiles.ActiveProfile = "MyProfile"
    End Sub

    The code works Ok most of the time, then fails at the application, so I can't set the preferences object. It only works if I do the full statement like this: ThisDrawing.Application.Preferences.Profiles.ActiveProfile="MyProfile"

    I s there any reason for this? Its a bugger to deal with as there is apparently no reason for it and how would I test for it anyway?
     
    terencechatfielduk, Sep 16, 2004
    #1
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.