0

SO I'm trying to create an app where I have an excel file in the app itself and then open it in excel when a user presses the button. I'm fairly new at this so I'm not terribly sure what to do. I've done the following:

string fileToLaunch = @"Assets\SOF.xltx";
private async void LaunchFileButton_Click(object sender, RoutedEventArgs e)
    {

        var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(fileToLaunch);

        bool success = await Windows.System.Launcher.LaunchFileAsync(file);

    }

What it gives me is a file not found error. If I use the same command with a png file it works fine. Any Ideas?

  • possible duplicate of [How can I open a file I've added to my Windows Store App project programatically?](http://stackoverflow.com/questions/26857144/how-can-i-open-a-file-ive-added-to-my-windows-store-app-project-programatically) – chue x Jul 11 '15 at 01:00
  • It could also be that you have the extension on the file wrong. Normally Excel files end in ".xlsx" – chue x Jul 11 '15 at 02:04
  • It's an excel template file – DevNoClu Jul 13 '15 at 16:29

0 Answers0