Step 1: Creating a Project and Adding a UDF ReferenceStep 1: Creating a Project and Adding a UDF Reference

In this step, you will create a project and add a reference to Microsoft.Office.Excel.Server.Udf.dll.In this step, you will create a project and add a reference to Microsoft.Office.Excel.Server.Udf.dll.

Creating the ProjectCreating the Project

The following project uses Microsoft Visual Studio 2005.The following project uses Microsoft Visual Studio 2005.

Note

[!REMARQUE] Depending on which settings you use in the Visual Studio integrated development environment (IDE), the process to create a project could be slightly different.Depending on which settings you use in the Visual Studio integrated development environment (IDE), the process to create a project could be slightly different.

To create a projectTo create a project

  1. Start Visual Studio.Start Visual Studio.

  2. On the File menu, point to New, and then click Project. The New Project dialog box appears.On the File menu, point to New, and then click Project. The New Project dialog box appears.

  3. In the Project Type pane, select Visual C# Projects.In the Project Type pane, select Visual C# Projects.

  4. In the Templates pane, click Class Library.In the Templates pane, click Class Library.

  5. In the Name box, type SampleUdf.In the Name box, type SampleUdf.

  6. In the Location box, type the path where you want to save your project, or click Browse to navigate to the folder.In the Location box, type the path where you want to save your project, or click Browse to navigate to the folder.

  7. Click OK. Your new project appears in Solution Explorer. You also will see that a file with the default name of Class1.cs has been added to your project.Click OK. Your new project appears in Solution Explorer. You also will see that a file with the default name of Class1.cs has been added to your project.

  8. You should see the following code in the Class1.cs file:You should see the following code in the Class1.cs file:


using System;
using System.Collections.Generic;
using System.Text;

namespace SampleUdf
{
    public class Class1
    {
    }
}

Imports System
Imports System.Collections.Generic
Imports System.Text

Namespace SampleUdf
Public Class Class1
End Class
End Namespace

Adding a ReferenceAdding a Reference

The following steps show how to locate Microsoft.Office.Excel.Server.Udf.dll and how to add a reference to it.The following steps show how to locate Microsoft.Office.Excel.Server.Udf.dll and how to add a reference to it.

To add a referenceTo add a reference

  1. On the Project menu, click Add Reference.On the Project menu, click Add Reference.

  2. In the Add Reference dialog box, on the .NET tab, select Excel Services UDF Framework.In the Add Reference dialog box, on the .NET tab, select Excel Services UDF Framework.

    Note

    [!REMARQUE] You can also open the Add Reference dialog box in Solution Explorer by right-clicking References and selecting Add Reference.You can also open the Add Reference dialog box in Solution Explorer by right-clicking References and selecting Add Reference.

  3. Click OK.Click OK.

    Note

    [!REMARQUE] The previous steps assume that you are building the project on a computer that has Microsoft SharePoint Server 2010 installed. On the computer where you have installed SharePoint Server 2010, you can find a copy of Microsoft.Office.Excel.Server.Udf.dll at: > [drive:]\Program Files\Common Files\Microsoft Shared\web server extensions\14\ISAPIThe previous steps assume that you are building the project on a computer that has Microsoft SharePoint Server 2010 installed. On the computer where you have installed SharePoint Server 2010, you can find a copy of Microsoft.Office.Excel.Server.Udf.dll at: > [drive:]\Program Files\Common Files\Microsoft Shared\web server extensions\14\ISAPI

Voir aussiSee also