Creating add-ins for Clear Office

by clearoffice 30. October 2009 07:19

The functions accessible from worksheet formulas are implemented as public static functions in special assemblies also called add-in.
Spreadsheet Clear Office comes with two add-ins:

  • The standard add-in (Office.Spreadsheet.StandardAddIn.dll) provides ”must have”  functions such as SUM, OR and LOWER
  •  the Analysis Toolpak add-in (Office.Spreadsheet.AnalysisToolpak.dll) contains more advanced functions such as ACCRINT, ISEVEN and PRICEDISC

By default, spreadsheet document have access only to these two add-ins but you can write your own add-in as well. The first step is create a .NET assembly with the appropriate settings. The second step is to make it accessible to spreadsheet document.
Add-in functions must verify the following:

  • They must be marked as public and static.
  • The containing class must be public and annotated with the [AddInFunctions] custom attribute.

Spreadsheet document discover add-ins through a SpreadsheetContext. By default, the spreadsheet context contains only the two built-in add-ins but you can create your own context with additional add-ins. If you do so, make sure you also add the built-in add-ins as well:

AddIn addIn1 = new AddIn(typeof (Office.Spreadsheet.StandardAddIn.LogicalFunctions).Assembly);
AddIn addIn2 = new AddIn(typeof (Office.Spreadsheet.AnalysisToolPak.DateFunctions).Assembly);
AddIn addIn3 = new AddIn(typeof (CustomSpreadsheetFunctions.MyFunctions).Assembly);
SpreadsheetContext context = new SpreadsheetContext(new AddIn[] {addIn1, addIn2, addIn3});


Once you have created your context, pass it to the spreadsheet document:

SpreadsheetDocument document = SpreadsheetDocument.Create(context);

Two samples demonstrate how to create and use add-ins: CustomSpreadsheetFunctions contains a custom add-in while HostCustomSpreadsheetFunctions uses this add-in.
If you decide to write your own add-in, you should make sure you avoid infinite loops and stack overflows as they would freeze the spreadsheet.

Tags:

Comments

4/27/2010 4:04:45 AM #

no fax payday loan

Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your site is greatly appreciated.

no fax payday loan United States | Reply

4/28/2010 3:47:13 AM #

Rapidshare

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Rapidshare United States | Reply

5/4/2010 9:37:21 PM #

Rapidshare Search engine

The functions accessible from worksheet formulas are implemented as public static functions in special assemblies also called add-in. Spreadsheet Clear Office comes with two add-ins:

The standard add-in (Office. Spreadsheet.

Rapidshare Search engine United States | Reply

6/16/2010 3:15:56 PM #

Svitlana.Net.Ua

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.

Svitlana.Net.Ua United States | Reply

6/19/2010 10:06:35 AM #

няня

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.
http://svitlana.net.ua/staff/category/3/ гувернантка, http://svitlana.net.ua/staff/category/5/ повар, http://svitlana.net.ua/staff/category/6/ садовник, http://svitlana.net.ua/staff/category/10/ репетитор, http://svitlana.net.ua/staff/category/4 домработница, http://svitlana.net.ua/staff/category/8/ семейная пара, http://svitlana.net.ua/pages/2/ работа няней.

няня United States | Reply

6/24/2010 9:03:35 PM #

Покер Онлайн

You got numerous positive points there. I made a search on the issue and found nearly all peoples will agree with your blog.

Покер Онлайн United States | Reply

6/26/2010 1:10:31 AM #

online payday loans canada

Your blogging site is very useful. Thank you greatly for delivering a lot of powerful strategies and information. I am going to bookmark your blog and will be undoubtedly returning. Once again, I truly appreciate your entire work not to mention delivering plenty of essential information for the many people.

online payday loans canada United States | Reply

7/3/2010 11:07:38 PM #

Лучшие индивидуалки

Когда настало время уезжать, мы нехотя бросали вещи в машину, и понимали, что прощаемся с морем до следующего  года, и ни где так не чувствуется приближение осени, как на море.

Лучшие индивидуалки United States | Reply

7/3/2010 11:59:51 PM #

Магазин сантехники

I like your blog so much that I feel I have to wish you. Happy New Year in advance. Have a nice and prosperous year ahead

Магазин сантехники United States | Reply

7/6/2010 9:27:18 PM #

проститутка Москвы

I really got a kick out of your article. I don\'t really have much to say in reply, I only wanted to comment to reply with wonderful operate. good luck in 2010.

проститутка Москвы United States | Reply

7/10/2010 9:26:13 PM #

Новинки сантехники

It\'s an intriguing approach. I ordinarily stumble upon ordinary thoughts on the theme but yours it\'s written in a pretty special way. Sure enough, I will revisit your website for additional information.

Новинки сантехники United States | Reply

7/11/2010 9:09:46 PM #

Проститутки

You gave nice ideas here. I done a research on the issue and learnt most peoples will agree with your blog. Certainly, these practices are unfair; but they say that most of their rules are only to apply to people who overdraw.

Проститутки United States | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Clear Office

Official Clear Office blog

Page List