Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Sep 02, 2021 9:15 pm

Hello.
I'm using C# with Spire.XLS in Windows and when I tried the Quick Start demo, there was an exception: "The specified executable is not a valid application for this OS platform".
A snipet of the code that I used was:
Code: Select all
            PlanExcel.SaveToFile(Arquivo);
            try
            {
                System.Diagnostics.Process.Start(PlanExcel.FileName);
            }
            catch (Exception ex)
            {
                MessageBox.Show("erro:" + ex.Message);
            }

Note that the file was created, but when it should be visible, there was that error.
Does anyone know what I did wrong?
Thank you.

ismajr99
 
Posts: 2
Joined: Thu Sep 02, 2021 9:04 pm

Fri Sep 03, 2021 9:21 am

Hi,

Thank you for your inquiry.
As you mentioned that the error occurred when opening the generated Excel, actually this issue is not related to our product. I guessed that your application type is .NET Core, right? If yes, kindly note that the System.Diagnostics.Process.Start("") command itself is not available in NetCore app. In generally, this command is used in NetFramework app to open a file. Maybe you can create an app with NetFramework to test this command. If there is any misunderstanding, please provide more information to clarify.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Fri Sep 03, 2021 11:21 am

Hi, Annika.
I use Visual Studio 2019 and work with a forms application. When I started the application I chose "Windows Forms Application". The same way it's proposed in your Spire.XLS for .NET Quick Start. So, how should I run Excel, after creating the spreadsheet? If you need more information, just ask me.
Thanks.

ismajr99
 
Posts: 2
Joined: Thu Sep 02, 2021 9:04 pm

Mon Sep 06, 2021 9:11 am

Hi,

Sorry for the late reply as weekend.
Our Spire.XLS demos are based on the NetFramework target, you need to confirm if the type of your app is NetFramework nor NetCore. Here I uploaded my sample demo whose type is NetFramework 4.7.2 for your reference. Please have a try on your side.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Fri Sep 10, 2021 10:14 am

Hi,

Hope you're doing well!
How is your issue going? Did the demo we provided work for you? Any feedback will be greatly appreciated.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS