Walkthrough: Developing a Managed-Code UDFWalkthrough: Developing a Managed-Code UDF

This walkthrough describes the process for developing Excel Services user-defined functions (UDFs) using Microsoft Visual C#.This walkthrough describes the process for developing Excel Services user-defined functions (UDFs) using Microsoft Visual C#.

During this walkthrough, you will learn how to:During this walkthrough, you will learn how to:

  • Create a project using the Microsoft Visual Studio 2005 class library project template.Create a project using the Microsoft Visual Studio 2005 class library project template.

  • Add a reference to Microsoft.Office.Excel.Server.Udf.dll.Add a reference to Microsoft.Office.Excel.Server.Udf.dll.

  • Write UDFs for use in Excel Services.Write UDFs for use in Excel Services.

  • Create a workbook to call custom functions from cells.Create a workbook to call custom functions from cells.

  • Test and run UDFs in Excel Services.Test and run UDFs in Excel Services.

PrerequisitesPrerequisites

In order to complete this walkthrough, you will need:In order to complete this walkthrough, you will need:

  • Microsoft SharePoint Server 2010Microsoft SharePoint Server 2010

    Note

    [!REMARQUE] The easiest way to get all you need on the server is to do a basic, stand-alone install. All you need to add on top of that is a trusted location.The easiest way to get all you need on the server is to do a basic, stand-alone install. All you need to add on top of that is a trusted location.

  • ExcelExcel

  • Visual Studio ou un outil de développement Microsoft.NET Framework compatible avec semblableVisual Studio or a similar Microsoft .NET Framework-compatible development tool

  • Pour permettre l’exécution de l’assembly de FDUTo enable running the UDF assembly

  • Une bibliothèque de documents SharePoint approuvée dans lequel vous stockez un classeur et autoriser le classeur à appeler l’UDF en définissant la valeur AllowUdfs sur trueA trusted SharePoint document library in which to store a workbook, and to allow the workbook to call UDFs by setting the AllowUdfs value to true

  • Un exemple de classeur qui appelle l’UDF stocké dans une bibliothèque de documents SharePoint approuvéeA sample workbook that calls the UDF stored in a trusted SharePoint document library

  • Autorisations d’afficher et de publier un classeur dans une bibliothèque de documents SharePointPermissions to view and publish a workbook to a SharePoint document library

    Note

    [!REMARQUE] For more information about setting permissions, see the Windows SharePoint Services 3.0 documentation.For more information about setting permissions, see the Windows SharePoint Services 3.0 documentation.

  • Pour créer le classeur à l’aide d’ExcelTo create the workbook using Excel

  • Pour enregistrer le classeur sous la forme d’un fichier .xlsx ou .xlsbTo save the workbook as an .xlsx or .xlsb file

    Note

    [!REMARQUE] For more information about how to trust a location, how to enable UDFs, and how to set the AllowUdfs flag, see Step 3: Deploying and Enabling UDFs.For more information about how to trust a location, how to enable UDFs, and how to set the AllowUdfs flag, see Step 3: Deploying and Enabling UDFs.

Voir aussiSee also