How do i export CATIA tree (containing sub-assemblies) to Excel sheet using VB script ?
Here is your macro,
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
'Input box to select txt or xls
Dim exportFormat As String
exportFormat = Inputbox ("Please choose format to export the tree as._ Type either 'xls' or 'txt'")
IF exportFormat <> "xls" THEN
IF exportFormat <> "txt" THEN
MsgBox "Did not enter txt or xls. Program cancelled please retry macro."
'Input box to enter name of file
Dim partName As String
partName = Inputbox ("Please enter the file name.")
'Input box to enter file location
Dim oLocation As String
oLocation = "C:\Macro Files\"
productDocument1.ExportData oLocation & partName & "." & _
Before runing as macro, change your file location on 6th line from bottom and enter extension as txt also xls format is not working.