Craig
Craig

Reputation: 1225

Excel Add-in connect to REST API

I need to write an Excel Add-In that communicates with an existing REST API that I created. The API allows the user to upload data from the excel spreadsheet to a SQL database. I am not sure how I accomplish this, so it would be great if I could get some sample code.

Upvotes: 2

Views: 8301

Answers (2)

Holger Leichsenring
Holger Leichsenring

Reputation: 811

What kind of Excel Add in do you write? I guess you'll use VSTO instead of plain old VBA or even c++ (xll).

For VBA and c++ it will surely be harder to do (and I do not have any samples for these for you), for vsto please have a look here: Calling a Web API From a .NET Client in ASP.NET Web API 2. It doesn't matter if you are in Excel or somewhere else, you just have to create an http client, configure that client, make your call and work with the result.

Upvotes: 0

e4rthdog
e4rthdog

Reputation: 5223

Take a look at these:

VBA-WEB github page

Excel Services REST API MSDN

Upvotes: 4

Related Questions