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

Free Support Forum - aspose.com

Using aspose cells and create .net object in coldfusion

i didn’t found any examples how to create an .net object in coldfusion using aspose.cells.

i try to open and read some values from a xls file.

i wrote this code but i get an error.

<cfset license.SetLicense(Aspose.Cells.lic)>
<cfset filexls.init(“template.xls”)>
Title:#filexls.Get_title()#

the error appears on line where the Aspose.Cells.Workbook object is created.
Unable to find a constructor for class Aspose.Cells.Workbook that accepts parameters of type ( java.lang.String ).

Hi,


Please check the article the article on how you can access .NET assemblies:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec13e1a-7ffd.html

Also, check the document:
http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/coldfusion-aspose-words-for-net.html

Although in the above topic, Aspose.Words for .NET component is used, but it will give you an idea how you can use Aspose.Cells for .NET in similar way as both products uses the same API model.

Thank you.

Hello,

I access the .net assembly but still i got the error on doc.Init part:
Unable to find a constructor for class Aspose.Cells.Workbook that accepts
parameters of type ( java.lang.String ).

Right now I used this code write almost the same as it is for Aspose.Words:

<cfset license.SetLicense(“Aspose.Cells.lic”)>
<cfset doc=CreateObject(".NET", “Aspose.Cells.Workbook”, assemblyPath)>
<cfset doc.Init(“C:\test.xls”)>
<cfset doc.Save(“C:\test2.xls”)>

Without the line with doc.Init(“C:\test.xls”) test2.xls file is saved correctly as an empty file.

it works with doc.Open

thread can be closed.



Hi,


That’s good.

Yes, you still may use Workbook.Open() method which is not eliminated but obsoleted which can work for your needs as you find issue while using Workbook constructor.

Thank you.