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

I was able to get this error by running your code on an assembly where an occurrence within a component pattern was suppressed. Could that be the issue for you?

 

If so, you could solve the issue by making sure the suppressed occurrence is not part of a pattern, and if it is, leave it alone. This tweak will do that:

 

If occ.Suppressed Then
	If Not occ.IsPatternElement Then
		occ.Delete
	End If
Else
	Call DeleteSuppressedComponent(occ.SubOccurrences)
End If