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