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

Some items I can see incorrect are the following

  1. The partnumber variable was not been set but rather the excel value was been set. This has been reversed. 
  2. ThisDoc.Document will be incorrect as it will reference the assembly. Use refDoc object if looping through assembly parts. 

Not shown but if your not filtering out assemblies in your referenced documents then you will get errors. Also if any of your parts are within sub assemblies then you might also get errors. Please share the whole code if you have further issues. 

For oRow = RowStart To RowEnd
	
	If (GoExcel.CellValue("A" & oRow)) = oDocNumber Then
		
       NewPN_1 = GoExcel.CellValue("B" & oRow) 
	
	   refDoc.SaveAs(Path & NewPN_1 & ".ipt", False)
	
	End If
Next

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan