none
Excel add-in: Loading CSV data from Yahoo URL RRS feed

  • Question

  • Hi,

    I have created an Excel Add-in using VS2015 and I am trying to pull CSV data from a Yahoo URL.

    I have created a simple Excel-add using the VS Template and injected the following code:

               

                $.ajax({
                    url: 'http://real-chart.finance.yahoo.com/table.csv?s=CVX&a=01&b=19&c=2001&d=01&e=19&f=2016&g=v&ignore=.csv',
                    type: 'GET',
                    dataType: "text/csv",
                    contentType:'application/json;charset=utf-8'
                }).done(function(data) {
                    app.showNotification(data.Status, data.Message);
                }).fail(function(status) {
                    app.showNotification('Error', 'Could not communicate with the server.');
                }).always(function() {
                 $('.disable-while-sending').prop('disabled', false);
                }); 


    When I execute it in Visual Studio, I am getting an "Access denied error". Debugging into JQuery shows that the xhr.open call fails:

              xhr.open( s.type, s.url, s.async );

    What am I missing? Do I need to add some permissions to the plug-in to access this URL? if so, where?

    Many thanks


    • Edited by Ckica Monday, September 5, 2016 4:45 PM forgot one line
    Monday, September 5, 2016 4:41 PM

Answers

  • >>>What am I missing? Do I need to add some permissions to the plug-in to access this URL? if so, where?

    According to your description, I have made a sample and reproduce this issue, and I also have created one ASP.Net project to try to load CSV data from Yahoo URL with your sample code, I still am not able to load CSV data successfully.
    Since The most basic Office Add-in consists of a static HTML page that is displayed inside an Office application, but doesn't interact with either the Office document or any other Internet resource. However, because it is a web application, you can use any technologies, both client and server side, that your hosting provider supports (such as ASP.net, PHP, or Node.js). To interact with Office clients and documents, you can use the office.js JavaScript API that we provide.

    I suggest that you could make sure that you are able to load CSV data from Yahoo URL without Excel add-in first, you could post your question on ASP.Net forum.

    http://forums.asp.net/

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Tuesday, September 13, 2016 2:29 PM
    • Marked as answer by David_JunFeng Thursday, September 15, 2016 2:31 PM
    Tuesday, September 6, 2016 7:07 AM