Walkthrough: Developing a Custom Application Using Excel Web Services

 

Walkthrough: Developing a Custom Application Using Excel Web Services

SharePoint 2010

Other Versions

 

Published: May 2010

The walkthrough in this section describes the process for accessing Excel Web Services from an application created with Microsoft Visual C#.

During this walkthrough, you will learn how to:

  • Create a client application using the Visual Studio Console Application project template.

  • Add a Web reference for Excel Web Services.

  • Write code to access the Web service. You will learn how to open a workbook, get the session ID, pass in the default credentials, get Web service version information, define the range coordinate object, get the range that uses the range coordinate object, close the workbook, and catch the SOAP exception.

  • Test and run the console application in debug mode.

A client console application is just one way to access the Web service. A more common way would be to use server applications, such as Microsoft ASP.NET applications. This walkthrough uses a console application example for simplicity, to focus on the Excel Web Services API aspects.

Prerequisites


In order to complete this walkthrough, you will need:

  • Microsoft SharePoint Server 2010.

  • Visual Studio or a similar Microsoft .NET Framework-compatible development tool.

  • Sufficient permissions (at the very least, "view" permissions) to be able to access Excel Web Services on the computer where SharePoint Server 2010 is located.

    Note Note

    For more information about workbook permissions, see the following section, "Workbook Permissions."

  • A sample workbook installed on a local drive or local SharePoint document library.

  • A trusted location to store the workbooks that you want to access using Excel Web Services. If the workbooks are not stored in a trusted location, the Excel Web Services calls to open the workbook will fail. This walkthrough assumes the workbook is present on the local computer.

    Note Note

    For information about how to trust a location, see How to: Trust a Location and How to: Trust Workbook Locations Using Script .

  • To create the workbook using Excel.

  • To save the workbook as .xlsx or .xlsb files.

The workbook used in this example has a worksheet named "Sheet1". The worksheet has 11 columns and 19 rows. Each cell from A1 to K19 contains a numeric value—for example, 4245.955, 6960.673, and so on.

Workbook Permissions


  • To get the entire workbook (for example, by calling the GetWorkbook method), the caller needs "open" permission fr the workbook.

  • To call the GetApiVersion method, no permission is necessary.

  • For the rest of the Excel Web Services methods, the caller needs "view" permission (in Microsoft SharePoint Foundation) or "read" permission (on a file share) for the workbook.

    Note Note

    For more information about setting permissions, see the SharePoint Foundation documentation.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值