Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Catia Export Specification Tree to Excel or text file

Status
Not open for further replies.

NaWin55

Mechanical
Joined
Mar 21, 2020
Messages
98
Location
IN
Hello
I have created this macro to export Specification tree from catia to excel or text file format
but i am getting this error and i dont know how to correct it
here is the VBSCRIPT

Option Explicit

Sub CATMain()

'Launguage - VB SCRIPT
'Macro - Export Specification tree
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Declare Variables
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim myDoc As Document
Dim myPart As Part
Dim partDoc As PartDocument

'Set Variables Values
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set myDoc = CATIA.ActiveDocument
Set myPart = CATIA.ActiveDocument.Part
Set partDoc = CATIA.ActiveDocument


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Export Script
Dim exportFormat As String
exportFormat = InputBox("Enter the format to export the tree as._ type 'xls' or 'txt'")

If exportFormat <> "xls" Then

If exportFormat <> "txt" Then

MsgBox "Did not enter the file format"

Else

Dim partName As String
partName = InputBox("Enter the name of the part")

Dim location As String
location = "D:\CatiaMacro"
partDoc.ExportData location & partName & "." & exportFormat, "txt"

End If
End If

End Sub

Here is the Error
Error_jpfk5h.jpg

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top