The practical solution would be to use late binding (getting a reference using CreateOleObject
and having the references resolved at runtime) instead of using early binding via the typelibs. This would mean that as long as the vendor doesn't remove functionality, your code would continue to work regardless of what version of the control was installed.
For examples of doing this with MS Office applications, you can see several of the old (but still accurate and usable) posts at Deborah Pate's site (see note below). For instance, this one for Word uses late binding to either retrieve the currently running Word instance or create a new one:
var
Word: Variant;
Filename: OleVariant;
begin
try
Word := GetActiveOleObject('Word.Application');
except
Word := CreateOleObject('Word.Application');
end;
FileName := 'C:\WordDocs\MyFile.doc';
Word.Documents.Open(FileName, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam);
Word.Visible := True;
Note that there is no included type library here, and no prior declaration of Word.Documents
or the Documents.Open
method. These are both resolved for you at runtime, and if not implemented will raise an exception.