IRelationshipClass::GetRelationshipsForObjectSet method will give automation error in the presence of a single quote character in the source and destination table of the relationship.
use vb functions to detect the presence of single quote character and eliminate it or not execute IRelationshipClass::GetRelationshipsForObjectSet method in that case.