+ Reply to Thread
Results 1 to 2 of 2

Not able to call web service with Excel 2007

  1. #1
    Registered User
    Join Date
    10-11-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Not able to call web service with Excel 2007

    Hi,

    I am trying to call a sample webservice which is available for free.

    I created web reference for Live search web service. and created this function ( below) :



    public void DisplayWebServiceResults()
    {



    try
    {

    SearchL.

    BingService service = new ExcelWorkbook2.net.live.search.api.BingService();
    SearchL.

    SearchRequest reqParam = new ExcelWorkbook2.net.live.search.api.SearchRequest();
    reqParam.AppId =

    "XXXX";
    reqParam.Sources =

    new ExcelWorkbook2.net.live.search.api.SourceType[] { SearchL.SourceType.Weather };
    reqParam.Query =

    "New";
    System.Net.

    IWebProxy P = new System.Net.WebProxy(http://X.X.X.X);
    service.Proxy = P;

    SearchL.

    SearchResponse respParam = service.Search(reqParam);


    Tools.

    NamedRange range = (Tools.NamedRange)this.Controls["Data"];
    range.Clear();

    ((Excel.

    Range)range.Cells[1, 1]).Value2 = respParam.ToString();
    }



    catch (Exception e1)

    {}

    }

    

    I am creating Ribbon (Visual designer) and I created a button. In the button click event I said :

    Globals.Sheet1.DisplayWebServiceResults();

    Even then, when I click the button, it is not working. It is getting struck after the service object is created for Bing service.

    This is an urgent requirement. I am not able to figure out the issue. Can you please help me fix this issue.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Not able to call web service with Excel 2007

    Firstly, can you put your code in code tags please?

    Secondly, this is C# code, I think you're probably posting in the wrong forum - you might be better off posting in a .net forum

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1