ASP errors with new version!

Hi,

We use several Apsose components. However we have now hit come trouble when trying to use the new Aspose.Cells. We use all three components in our ASP software.

We used the ASP guide found on the following page http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/AccessingComponentFromCOMClients.html. However the xls.open_2 method no longer works. The following error is observed: Invalid procedure call or argument: ‘xls.Open_2’.

Is there anyway you could update the guide on that page or give me the new method names?

Many Thanks

Greg Pakes

Hi Greg,

Thanks for your information.

I have updated the guide. Please try the sample code at Accessing Component From COM Clients.

Laurence,

Thanks very mcuh for the new code - however I am still having problems.

The problem occurs with the following line:

Set xls = CreateObject(“Aspose.Cells.Workbook”)

with the error message: Server.CreateObject Failed.

If i change that line to the following:

Set xls = CreateObject(“Aspose.Cells.Excel”)

I get a different error on this line:

xls.Open_5

with the message:

Invalid procedure call or argument: ‘xls.Open_5’

I am running the latest apsose.cells version: 4.0.2.0

Many thanks.

Greg



Hi Greg,

I think your application refers to an old version of Aspose.Cells because in v4.0.2, Excel class is replaced with Workbook class.

Please go to the folder which contains the old dll and run the following command:

regasm Aspose.Cells.dll /u

Please go to the folder which contains the new dll and run the following command:

regasm Aspose.Cells.dll /codebase

Laurence,

Thanks for the help.

I have run these two commands and something has definitely changed, however I still get an error.

I now get the following error:

ActiveX component can’t create object.

on the following line:

Set xls = server.CreateObject(“Aspose.Cells.Workbook”)

I appreciate all your help.

Regards

Greg Pakles

Please run the following command with attached vb script file:

cscript test.vbs

I have run the script and get the following error:

Line:13
Char:1
Error: 0x80131509
Code: 80131509
Source: (null)

I commented out that line and get a vba.xls excel document created that appears to work absolutely fine.

What does this tell us?

For Error: 0x80131509, I think it's a problem of your OS. What's the OS and .NET version in your machine? Have you installed the latest windows hotfix?

If you run the command and create an excel file without problem, it indicates that COM interop with Aspose.Cells are fine. If you asp page still doesn't work fine, you may have to restart your machine.

I rebooted the machine and it still did not work - however it has now started working!!

I am now having problems with:

cells.item_2(i,j).PutValue_5 "string"

This does not put the value in a new cell. There is a square symbol between the text that is supposed to be a new cell.

For instance:

Name[]Age

Name and Age are supposed to be in different cells, however they are seperated by this square.

Any ideas?

Many thanks for the excellent support so far.

It seems that your text conains "\r\n" (char 10 and char 13).

If you want to put "Name" and "Age" in difference cells, you should do this:

cells.item_2(i,j).PutValue_5 "Name"

cells.item_2(i,j + 1).PutValue_5 "Age"


Laurence,

This is the code I am running. The exact code is as follows:

cells.item_2(0,0).PutValue_5 "Name"
cells.item_2(0,1).PutValue_5 "Age"
cells.item_2(1,0).PutValue_5 "Test Name"
cells.item_2(1,1).PutValue_5 "Test Age"

And please find attached the excel document output.

Please try:

xls.Save_3 stream, 2

Laurence,

Thank you very much for all your help, however I am not completely sure how I would incoorporate this into my code. Currently i do this:

call xls.Save_3 (server.mappath(sPath),2)

What does the stream do?

When you check Aspose.Cells API reference, you can find several overloaded Workbook.Save functions. Since ASP doesn't support overloaded functions, it converts them to Save_2, Save_3.

Since your code saves file to disk, you can try:

call xls.Save_2(server.mappath(sPath))