phuonghieu83
Automotive
- Mar 27, 2007
- 18
Hello,
I'm writing a litte VBA macro in CATIA V5. I had an error message by adding a file into a product in using the function : AddComponentsFromFiles. The error message is "Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic ".
CATIA Version : V5R18
VB 6.0
References of VBA project :
Here is the code :
Sub CATMain()
If (False = Inits()) Then
Exit Sub
End If
Dim objProducts As Products
Dim objProduct As Product
Dim iProduct As Product
Dim iProducts As Products
Dim arrayOfVariantOfBSTR1(0)
arrayOfVariantOfBSTR1(0) = "X:\3113261-CGR-200900825-11521.cgr"
Set objProduct = objCATIAV5CurrentDoc.Product
Set objProducts = objProduct.Products
objProducts.AddComponentsFromFiles arrayOfVariantOfBSTR1, "All"
End Sub
Can anyone help me in this sujet?
Thank you in advanced.
I'm writing a litte VBA macro in CATIA V5. I had an error message by adding a file into a product in using the function : AddComponentsFromFiles. The error message is "Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic ".
CATIA Version : V5R18
VB 6.0
References of VBA project :
Here is the code :
Sub CATMain()
If (False = Inits()) Then
Exit Sub
End If
Dim objProducts As Products
Dim objProduct As Product
Dim iProduct As Product
Dim iProducts As Products
Dim arrayOfVariantOfBSTR1(0)
arrayOfVariantOfBSTR1(0) = "X:\3113261-CGR-200900825-11521.cgr"
Set objProduct = objCATIAV5CurrentDoc.Product
Set objProducts = objProduct.Products
objProducts.AddComponentsFromFiles arrayOfVariantOfBSTR1, "All"
End Sub
Can anyone help me in this sujet?
Thank you in advanced.