none
ASP.NET MVC: Excel Pivot Table source file can't be opened RRS feed

  • Question

  • Hi,

    I am creating and saving to a physical path a new Excel file from an ASP.NET MVC application with a sheet for the pivot table and another sheet 'Data Sheet' for its data source. When I first open the file from the download prompt, I get the following error popup.

    Cannot open PivotTable source file 'http://localhost/.../.../[...]DataSheet'.

    but if I close the file and not save it, then go to its location and open it, everything is fine.

    Is there a way to mitigate this error?

    Thanks in advance.

    Monday, March 5, 2018 6:04 PM

All replies

  • Hi Hackathor,

    Do you mean , If you do not open the file from the download prompt and open it from the location then it work properly?

    It is possible that Excel not able to find the source file.

    please check that it is available and accessible.

    Are you able to access the file if you put the URL in browser?

    If possible then you can try to post the sample code and the sample Excel file.

    We will try to make a test with your file and try to reproduce the issue.

    We will also try to check the file created by you which cause the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 6, 2018 8:33 AM
    Moderator
  • Yes you are right. Only when I click Open, the file opens with that popup message, which I would not want clients to see. But if I click Save or Save As from the download prompt, everything is fine. The URL brings me to the home page of my MVC application.
    Tuesday, March 6, 2018 3:12 PM
  • Hi Hackathor,

    I try to make some research on error ,"Cannot open PivotTable source file"

    Following are the causes for this issue.

    (1) the excel file was received from another person, and it was created in a previous version of excel, this is one of the cases when the option from Excel Options-Trust Center-Privacy Options: “Remove personal information from file properties on save” is checked.
    (2) the file contains a pivot table, with or without a pivot chart.
    (3) the pivot chart, or the pivot table, (or both), is moved into another sheet (the chart with cut-paste, pivot with the option-Move Pivot Table)

    Below are the work around for the issue.

    (1) Make a copy of the worksheet with the old pivot table and pivot chart in a different workbook;
    (2) Move the copied worksheet back into the original workbook;
    (3) Change the new chart’s source data to the new pivot table;
    (4) Change the pivot table’s data source to the new range;
    (5) Refresh the pivot table.

    Reference:

    Can’t Open Pivot Table Source…

    But I can see that none of the work around can solve your issue as all work around need to open the file and you need something that can work before opening the file from the open prompt in browser.

    I suggest you to provide your feedback to Excel User Voice about this issue.

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 7, 2018 1:39 AM
    Moderator