locked
Is it possible to open Excel file in XAML Windows Store App?

    Question

  • Hi,

    I want open excel file from local folder(not from Url) within the windows store app.

    Could you please help me how to implement ?

    Thanks,

    Siva varri


    Thread response from msdn

    Thursday, February 5, 2015 4:50 AM

Answers

  • Hi,

    If you want to open an excel file by a windows store app. There is no direct API in windows store app can handle excel file. You will need to find a third party component. But if you want to launch a file into its default handler, please see  Launcher.LaunchFileAsync API. And you can refer to the link below:

    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh779671.aspx

    private async void Button_Click(object sender, RoutedEventArgs e)
            {
                StorageFolder storageFolder =
                    Windows.Storage.ApplicationData.Current.LocalFolder;
                StorageFile file =
                    await storageFolder.GetFileAsync("56.xlsx");
    
       if (file != null)
       {
          // Launch the retrieved file
          var success = await Windows.System.Launcher.LaunchFileAsync(file);
    
          if (success)
          {
             // File launched
          }
          else
          {
             // File launch failed
          }
       }
       else
       {
          // Could not find file
       }
    
            }
        }

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, February 5, 2015 6:58 AM