Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: MechMachineMan

MechMachineMan,

 

I appreciate the quick response.  I'm not really good at this whole iLogic thing.  I thought I interpreted your code correctly.  If I run the code below, a message appear twice that says "SaveAs method of Workbook class failed".  Do you mind elaborating on your code?

 

Thanks.

 

 

Dim oDoc As Inventor.DrawingDocument
oDoc = ThisDoc.Document

Dim oSheet As Inventor.Sheet
'oSheet = oDoc.Sheets(1) ' first sheet
oSheet = oDoc.Sheets("SPOOL:1") ' sheet by name


' say there is a Partslist on the sheet.
Dim oPartslist As PartsList
oPartslist = oSheet.PartsLists(1)


For j=1 To oDoc.Sheets.Count
'Code
If oSheet.PartsLists.Count > 0
'Go on with export.
oPartslist.Export(folderName & oSheet.Name & ".xls", PartsListFileFormatEnum.kMicrosoftExcel)


End If
Next