Aspose APIs save you from MS Office Automation hell
Tags: dotnet, csharp, office, programming
Published: 2019-07-23 10:29:23

<h2>Intro</h2>
<p>Sometimes there is a need to automate the process of handling MS Office file formats. For example, the data volume you need to represent is too large to process it manually. Or you might need to use complicated animations, web content or execute other untrivial scenarios on your data. Or you just don’t like to use your hands.😊 </p>
<p>For such purpose, in .NET you can go two ways: using native Microsoft libraries or the third-party solution like <strong><a href="https://www.aspose.com/?utm_source=https://dev.to/aspose_slides/aspose-apis-save-you-from-ms-office-automation-hell-59dh&utm_medium=email">Aspose product family<a/></strong>.
It would sound logic to use the native MS solution, but things are not that smooth here. Let us see why.
</p>
<hr/>

<h2>Why not Office Automation</h2>

<h4>MS Office required</h4>
<p>Microsoft provides Office Automation technology that allows you to interact with Office as COM objects. To use it you need to install Microsoft Office on your computer, and include Microsoft.Office.Interop library into your project.</p>

<h4>Not server-side</h4>
<p>Another problem of using Office Automation technology comes from the architectural design of the Office. It wasn’t meant to meet the needs of server-side components that are designed to run unattended. Microsoft.Office.Interop shows an unstable behaviour, throwing unexpectable exceptions that you cannot handle in a proper way, because of their unclear description (as “The RPC server is unavailable”). Sometimes, the library produces client intended alerts (like “Document is protected”) making the application process restart. And you cannot do anything with that, because you cannot access those alerts via COM. 
</p>

<h4>Memory leaks</h4>
<p>Microsoft.Office.Interop is based on COM Interop technology, and the usage of it from the managed code often causes serious problems as memory leak. You have to take care of the COM object’s lifecycle, because sometimes your Office Application process may not exit even after you’ve shut down.
</p>

<h4>Deployment problems</h4>
<p>The deployment is problematic, because using the Interop assemblies make you hardly tied on the Office version of your client’s machine.</p>

<h4>Development problems</h4>
<p>Among others, while working with Microsoft.Office.Interop library, you are forced to think in a low level terms. Problems with scalability and security make it impossible to use the technology in the enterprise level solutions.</p>

<h3>Conclusion</h3>
<p>It becomes too much challenging to solve all the troubles you meet while using Office Automate, that’s why <strong>even <a href="https://support.microsoft.com/en-gb/help/257757/considerations-for-server-side-automation-of-office">Microsoft do not suggest</a> to use it, and advices to give the priority to the third party libraries</strong>. Moreover, Microsoft do not maintain the technology and its documentation since 2015 nomore.</p>
<img src="https://catmacros.files.wordpress.com/2009/07/cat-halp-1-1.jpg"  width="400" style="float:left">
<hr>

<h2>Why Aspose products</h2>
<p>Aspose APIs are the set of libraries to process all the MS Office file formats. You can work with word, powerpoint, excel, notes, visio, outlook and other formats. The libraries allow to manage the texts, images, shapes, tables, animations, audio and video, emails, watermarks, hyperlinks in your files. Every API has the  powerful security instruments to protect your documents.</p>

<h4>No MS Office required</h4>
<p>Many of the benefits of using Aspose APIs come from the fact that it’s a third party solution, that do not use Office Automate technology under the cover. You don’t need MS Office to be installed on the computer; its compatible with other .NET applications and you can forget about deployment problems.</p>

<h4>Not only MS Office file formats</h4>
<p>Aspose APIs support all the latest versions of file formats. It is possible to create and modify files or separate pages, export and convert them into plenty of MS Office and non-MS Office formats.</p>

<h4>High-level object model</h4>
<p>Aspose libraries represents the high-level object model for managing documents and their elements, you dont need to take care of the low level MS Office mechanisms. Just think in terms of documents, pages, texts and shapes - dont worry of managing streams, object lifecycles and others.</p>

<h4>Compatible with any type of OS, .NET application</h4>
<p>You can easily build your system, that uses the library on any 32-bit or 64-bit system and in any type of .NET application: C#, ASP.NET, WinForms, Xamarin, etc.</p>

<h4>Quality guarantee</h4>
<p>Aspose has been one of the first vendors on the market, who started to provide the file formats processing APIs long time ago. You can be sure - they know everyting about file formats and their solutions have been proved with the time.</p>
<p>Being the commercial solution, every Aspose product is proven with a guarantees of stability, maintenance, security and support.
On Aspose site you can find a detailed guide for .NET with a lot of code samples. You can easily contact the support team to get a quick help.</p>


<h3>Conclusion</h3>
<p>When it comes to automate MS Office file formats processing, there is nothing better than using third-party products like Aspose APIs.
The Aspose APIs are the high-quality products created by the principle: <strong>"Developers for developers"</strong>.</p>