Excel file - save function

Hi there,

was hoping if you can help me with this.

I have a couple of methods that read from a excel file containing data (rawdata.xls), do some processing and I output (save) this to a file of different name (for eg. test.xls).

the other method is going to open this output file test.xls and do some processing as well. Yet when I tried to save it with the same name (test.xls), it doesn't work. The output file is empty.

I wish to save it with the same name and I don't want to have multiple files generated.

thanks for your help!
Kelly

Hi Kelly,

Could you please create a simple console project to show your problem? That will help us to check your problem. Thank you very much.

Hi,

Thanks for considering Aspose.

How do you save the file(s) into the two methods? Could you paste here your sample code, so that we may check and resolve your issue soon.

Thank you.

Hi,

Sure.

method 1
{
template.open("rawdata.xls", Aspose.cells.fileformatType.default);
//do processing

template.save("report.xls", Aspose.cells.fileformatType.default);
}

method 2
{
template.open("report.xls", Aspose.cells.fileformatType.default);
//do processing

template.save("report.xls", Aspose.cells.fileformatType.default);
}

Does this help ?
thanks

Hi,

Following is my code and it works fine:

private void button6_Click(object sender, System.EventArgs e)

{

Workbook template = new Workbook();

Method1(template);

Method2(template);

}

private void Method1(Workbook template)

{

template.Open("d:\\test\\book1.xls");

template.Worksheets[0].Cells["A7"].PutValue("Testing123");

template.Save("d:\\test\\testreport.xls");

}

private void Method2(Workbook template)

{

template.Open("d:\\test\\testreport.xls");

template.Worksheets[0].Cells["A8"].PutValue("HelloWorld!");

template.Save("d:\\test\\testreport.xls");

}

Which version of Aspose.Cells you are using? Please try the latest version(4.2.0.0)

If the problem still persists, please create a sample console app, zip it and post us here.

Thank you.

Hi,

I am using version 3.7.0.0. Is this the reason that causing this?

thanks

Hi,

Could you try my code using 3.7.0.0.

Thank you.

Hi Kelly,

Please download and try the latest version at www.aspose.com/downloads. If it still doesn't work, please create a simple console project to show your problem. Thank you.

Hi

Can I email my codes to you? what's your email add?

Can't seem to instantiate the workbook class though..

Thanks

Just found out from Lawrence's blog that I can only use Excel instead of Workbook since I am using an older version. (right?)

It is working now.. Amjad, I have tried your way.. thanks alot.

nanjing@aspose.com