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.

Sat Oct 21, 2017 12:26 pm

Hi Team,

Thanks for this wonderful package. I was curious and wanted to try out the package. Unfortunately, i have hit the wall and i am trying the understand what exactly is the reason for my error. This is the code. This is the simplest of codes that should get me started. But i get an exception thrown at this line "Workbook workbook = new Workbook();"

An unhandled exception of type 'System.TypeInitializationException' occurred in Spire.XLS.dll
Additional information: The type initializer for 'spr106' threw an exception.


Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Spire.Xls;
using System.Data.SqlClient;

namespace BIDQA
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {
           
        }
     

        private void button1_Click(object sender, EventArgs e)
        {

            //Creates workbook
            Workbook workbook = new Workbook();

            //Gets first worksheet
            Worksheet sheet = workbook.Worksheets[0];

            //Writes hello world to A1
            sheet.Range["A1"].Text = "Hello,World!";

            //Save workbook to disk
            workbook.SaveToFile("C:\\Users\\a0724960\\Desktop\\sample.xlsx");
           
        }

    }
}


I really wanted to understand what might be the cause and potential fix for this

Many thanks

sachi
 
Posts: 1
Joined: Sat Oct 21, 2017 12:20 pm

Mon Oct 23, 2017 3:37 am

Hi sachi,

Thanks for your inquiry.
Please reference the Spire.Pdf.dll from the same place with Spire.Xls.dll in your protect.
Any question, please feel free to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Oct 24, 2017 9:41 am

Hi sachi,

Greetings from E-iceblue.
Has the issue been resolved ?
Could you please give us some feedback ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS