Message 1 of 17
Export parts List to Excel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
We have just upgraded from Inventor 2014 straight to 2021.
We export our parts list (Drawing Parts list) to excel and in the template we have a column set up with a formula to check some data is correct. When exporting from 2014 this worked well but since upgrading when exporting it now removed the formula all together.
Am i missing something??
We use Excel 2010
I have included our export rule below
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet Try Dim oPartslistCheck As PartsList oPartslistCheck = oSheet.PartsLists(1) partslistpresent = True Catch partslistpresent = False End Try If partslistpresent = True Then 'Set a reference to the first parts list on the active sheet. This assumes that a parts list is on the active sheet. Dim oPartList As PartsList oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1) Dim oPartNumber As PartsListCell Dim oType As PartsListCell Else MessageBox.Show("No Parts List Found", "Title") Return End If 'Get the path and name of the drawing file path_and_name = ThisDoc.PathAndFileName(False) ' without extension 'Define oDoc oDoc = ThisDoc.Document 'Specify the drawing sheet oSheet = oDoc.Sheets("Sheet:1") ' sheet by name 'Say there is a Partslist on the sheet. oPartslist = oSheet.PartsLists(1) 'Create a new NameValueMap object oOptions = ThisApplication.TransientObjects.CreateNameValueMap 'Specify an existing template file to use For formatting colors, fonts, etc oOptions.Value("Template") = "S:\CAD\Standards\_Template Library\Excel\Ostendo Parts List.xls" 'Specify the columns to export oOptions.Value("ExportedColumns") = "Project Number;Job Number;Ostendo Part Number;Ostendo Descriptor;DESCRIPTION;QTY;BASE UNIT;DRAWING No.;MATERIAL;Ostendo Total Qty;PART LENGTH/M2 (REF)" 'Specify the start cell oOptions.Value("StartingCell") = "A7" 'Specify the XLS tab name here the file name is used oOptions.Value("TableName") = ThisDoc.FileName(False) 'without extension 'Choose to include the parts list title row in this example "Ye Old List of Parts" is written to the StartingCell oOptions.Value("IncludeTitle") = False 'choose to autofit the column width in the xls file oOptions.Value("AutoFitColumnWidth") = True 'check for existing XLS file and delete it if found If Dir(path_and_name & " - Ostendo Parts List.xls") <> "" Then Kill (path_and_name & " - Ostendo Parts List.xls") Else End If 'export the Partslist to Excel with options oPartslist.Export(path_and_name & " - Ostendo Parts List.xls", PartsListFileFormatEnum.kMicrosoftExcel, oOptions) MessageBox.Show("Ostendo Parts List Created", "Title")