×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Compile Problem

Compile Problem

Compile Problem

(OP)
Hi,
I have the following similified code running in Excel.

CODE

    Dim objDoc As SolidEdgeDraft.DraftDocument
    
    On Error Resume Next
    
    ' Make sure SolidEdge is already open
    Set objApp = GetObject(, "SolidEdge.Application")
    If ((Err) Or (objApp Is Nothing)) Then
        MsgBox "Solid Edge must be running."
        Exit Function
    End If
    
    ' Make sure the active environment is Draft.
    If (objApp.ActiveEnvironment <> "Detail") Then
        MsgBox "You must be in the Draft environment."
        Exit Function
    End If

    For i = 0 To objApp.Documents.Count
        Set objDoc = objApp.Documents(i)
        
        If (objDoc.Type = igDraftDocument) Then
        
            objDoc.Activate

            ....
        end if
    ....    
    next

When I run it on one computer everything is fine, however when I run it on another the VBA editor gives the following error:

Compile error:
Method or data member not found

and points to the line 'If (objDoc.Type = igDraftDocument) Then'
implying objdoc does not have a type data member.

How can this run on one computer and not another.  

To add to the confusion, this is an EXACT copy of another program only with a few additions which works on BOTH machines without problem!!!

Can anyone shed some light on this please?

Thanks

RE: Compile Problem

Do you have all the same reference libraries on each machine?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources