http://francois-piette.blogspot.be/2013/04/delphi-xe4-ms-office-components.html

http://francois-piette.blogspot.be/2013/04/delphi-xe4-ms-office-components.html

Comments

  1. Most flexible way is to use OLE automation though, you lose static checks (for what they're worth against office) but you gain ability to selectively and dynamically adapt to the office version you're facing in a single code, and more generally code against features rather than versions.

    ReplyDelete
  2. Not only you lose static checks but also code insight. I consider both as invaluable. Since I always use basic Office features, existing in all Office versions since '97, I always use the oldest Office component wrappers and my code works for almost every Office. What annoys me a lot with OLE automation is that you discover errors at runtime. It is very difficult to be sure your application won't crash. Using the type libraries (component wrappers are using the type libraries), you mostly know that all the code is at least syntaxically correct.

    ReplyDelete
  3. True, but I find you have to test anyway in all versions, and that the VBA environment is even more convenient, so I usually develop the snippets in VBA (from inside office, where you get debugging and code writing support way above what's available in Delphi even with COM) and then convert/use it from Delphi.

    ReplyDelete

Post a Comment