We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose noob; Help!

Aspose seen by project until compile. Disappears until restart of VS. All is good again until compile attempt, disappears again. ???

Hi Mitch,


Thanks for contacting support.

Can you please share which component you are using in your application and if possible can you please share the sample project so that we can test the scenario at our end. We are sorry for this inconvenience.

While waiting for your reply, I quickly put together another project. A sort of Hello world project, pretty much copied from your samples. The thought being that if it were my project, that would all fall out in the wash and I would have a place to start from.


However, the Hello World also does the same thing, so I’m inclined to believe it is my environment.

I have, however, attached my Hello World project for your scrutiny.

Thanks for your assistance,

Mitch


Hi,


Please use Workbook constructor to open the template file and do not use Workbook.Open method. Here is the complete runnable sample code with latest version e.g v7.4.3, it works fine. I can generate the file from the template file, all the values are added / updated in the output file. I have attached the sample input and output files here for your reference.

Sample code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Cells;

namespace Aspose_Trials
{
class Program
{
static void Main(string[] args)
{
var path = “e:/test2/Book1.xlsx”;
var wrkbk = new Workbook(path);
Worksheet wrksht = wrkbk.Worksheets[0];

wrksht.Cells[“A1”].PutValue(“Cell Value”);
wrksht.Cells[“A2”].PutValue(“Hello World”);
wrksht.Cells[“A3”].PutValue(true);
wrksht.Cells[“A4”].PutValue(100);
wrksht.Cells[“A5”].PutValue(2856.5);
wrksht.Cells[“A6”].PutValue((123.6).ToString(), true);
object obj = “Aspose”;
wrksht.Cells[“A7”].PutValue(obj);
var dt = DateTime.Now;
wrksht.Cells[“A8”].PutValue(dt);
var style = wrksht.Cells[“A8”].GetStyle();
style.Font.IsBold = true;
style.Font.Size = 15;
for (int i = 1; i < 8; i++)
{
switch (wrksht.Cells[i, 0].Type)
{
//Cell value is boolean
case CellValueType.IsBool:
wrksht.Cells[i, 1].PutValue(“IsBool”);
break;
//Cell value is datetime
case CellValueType.IsDateTime:
wrksht.Cells[i, 1].PutValue(“IsDateTime”);
break;
//Blank cell
case CellValueType.IsNull:
wrksht.Cells[i, 1].PutValue(“IsNull”);
break;
//Cell value is numeric
case CellValueType.IsNumeric:
wrksht.Cells[i, 1].PutValue(“IsNumeric”);
break;
//Cell value is string
case CellValueType.IsString:
wrksht.Cells[i, 1].PutValue(“IsString”);
break;
//Cell value type is unknown
case CellValueType.IsUnknown:
wrksht.Cells[i, 1].PutValue(“IsUnknown”);
break;
}
}
wrkbk.Save(path+ “out.xlsx”);
}
}
}

Let me know if you still have any issue.

Thank you.