kohsuke / com4j

Type-safe Java/COM binding
http://com4j.kohsuke.org/
BSD 2-Clause "Simplified" License
146 stars 78 forks source link

Is late binding with Com4j possible? #46

Open lawern opened 9 years ago

lawern commented 9 years ago

Hello,

looking for a solution to use Excel COM objects in Java I found Com4j. Until now I was able to implement a lot of code, but I am now encountered a problem with the CustomProperties in Excel Workbooks. Tlbimp generates correct Workbook and DocumentProperties classes, but the following command unfortunately returns "null":

DocumentProperties customDocumentProperties = workbook.customDocumentProperties().queryInterface(DocumentProperties.class);

The problem is not new and occurs also for C#. A solution for C# is described here:

Is the there described late binding approach in Com4j also possible? Or knows someone another way to get the right DocumentProperties object?

Many Thanks!

Lars