Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CATIA V5 VBA (selection command)

Status
Not open for further replies.

AVIS0202

Automotive
Mar 27, 2017
7
0
0
IN
hi,
I'm a starter to VBA in CATIA V5 and im using Nick Weisenberger's material. while coming across selection command i experienced run time error

Sub CATMain()
'display the path name of the file
Dim doc1 As Document
Set doc1 = CATIA.ActiveDocument
MsgBox doc1.FullName

'display the no. of selection
Set doc1 = CATIA.ActiveDocument
MsgBox doc1.Selection.Count

Dim part_1 As Object
Set part_1 = CATIA.ActiveDocument

'display the selected document
Dim objectsel As Selection
Set objectsel = CATIA.ActiveDocument.Selection
objectsel.Clear
[highlight #FCE94F]objectsel.Add (part_1)[/highlight]

End Sub

the error was
run-time error '438'
object doesn't support this property or method
Object doesn't support this property or method (Error 438)


Not all objects support all properties and methods. This error has the following cause and solution:

You specified a method or property that doesn't exist for this Automation object.
See the object's documentation for more information on the object and check the spellings of properties and methods.

You specified a Friend procedure to be called late bound.
The name of a Friend procedure must be known at compile time. It can't appear in a late-bound call.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).



if any one could help me with explanation and solution it would of great help
 
Status
Not open for further replies.
Back
Top