Cells in classic ASP

Hello,

doesn’t it work anymore to use Aspose.Cells in classic ASP ?

http://www.aspose.com/docs/display/cellsnet/Using+in+ASP+Scripts#UsinginASPScripts-HelloWorld%5C%21

Sample:
Dim xls : Set xls = Server.CreateObject(“Aspose.Cells.Workbook”)
Dim sheet : Set sheet = xls.Worksheets.item(0)

results in:
Microsoft VBScript runtime error '800a01b6’
Object doesn’t support this property or method: ‘xls.Worksheets.Item’

Hi,


Thanks for your posting and considering Aspose.Cells.

To use Aspose.Cells in classic ASP, you need advance technical skills. There are lots of issues which could not be fixed by clients as well as by product team. So you should create a wrapper assembly which should wrap Aspose.Cells and expose itself as a COM object. Please research on internet how to create a .NET assembly which could expose itself as COM object. If you are successful, then you can use all the features of Aspose.Cells in your classic ASP.

Please see this article if it is helpful for you in this regard.

  • Walkthrough: Creating COM Objects with Visual Basic

Please note, Aspose.Cells for C++ is under development but I think, it will not be helpful in classic ASP. So better thing is that you create a Wrapper Assembly yourself and use it in classic ASP.

FYI:

If you want to use Aspose.Cells from unmanaged C++ (using COM), then we recommend you to make a wrapper assembly and then call your own assembly from C++/COM.

For example, you can create a function inside the wrapper assembly

void ProcessRequest()
{
//all of your code using Aspose.Cells goes here
}

Then from unmanaged C++/COM, you call this function instead of directly calling Aspose.Cells from C++/COM.

Creating a Wrapper Assembly

If you need to use many of the Aspose.Cells classes, methods and properties, consider creating a wrapper assembly (using C# or any other .NET programming language), that will help to avoid using Aspose.Cells directly from unmanaged code.

A good approach is to develop a .NET assembly that references Aspose.Cells and does all the work with it, and only exposes the minimal set of classes and methods to unmanaged code. Your application then should work just with your wrapper library.

Reducing the number of classes and methods that you need to invoke via COM Interop could simplify your project, because using .NET classes via COM Interop often requires advanced skills.

You can research on internet how you can create such a wrapper assembly which could be used in C++/COM.

Besides, we now recommend C++ users to use Aspose.Cells for Cloud (REST based APIs). Because these APIs can be used in any platform and languages.

Please also read the following product pages to get familiar with the Cloud APIs.


Hello,

thank you for your detailed answer.
The short answer would be: No, you can’t.

I have no issues writing com-wrappers, your documentation just offer to use it in ASP classic, which is not possible (anymore), so imho you should update documentation.

Hi,


Thanks for your posting and considering Aspose.Cells.

We have marked the articles obsolete and will remove it as soon as possible.

Hi,

I worked a long while trying with VBScript many different ways to open or to save an Excel file but without any luck. I then unregistered net4.0 and registered net2.0 and was able to save but not to open a file. Below is my script, (I also tried to modify the code all different ways that i saw in other comments) can you please advice what i’m missing here?

Dim xls
Set xls = CreateObject(“Aspose.Cells.GridDesktop”)
xls.open_2 “C:\Users\ChaimB\Desktop\helfhwl.xlsx”
xls.Save_2 “C:\Users\ChaimB\Desktop\helfhwl.xlsx”
'I also tried xls.open “C:\Users\ChaimB\Desktop\helfhwl.xlsx”

I look forward to hearing from you soon

@ChaimBerger,

Do you want to use Aspose.Cells.GridDesktop control in Asp classic (VBScript) or you want to use Aspose.Cells library? Please note, both are different, Aspose.Cells is a .NET library and Aspose.Cells.GridDesktop is a separate desktop control. Aspose.Cells.GridDesktop cannot be used in Asp classic as it is a WinForm control.

Seeing your code segment (e.g xls.open_2), it looks like you are using Aspose.Cells library and find issue in this line of code. Please note in new versions, we replaced Workbook.Open method with its constructor, so if you are opening an Excel file via Aspose.Cells in C#.NET, you will write as following:

Workbook xls = new Workbook(“C:\\Users\\ChaimB\\Desktop\\helfhwl.xlsx”);

Now come to your issue, I do not find better resources (online) to get help on how to call its .NET class constructor in VBScript via COM interop. We believe, to use Aspose.Cells or any other .NET class library in classic ASP (JavaScript, VBScript) via COM, one should have advanced technical skills. There might be some issues which could not be coped with it. So as suggested in this thread, you should create a wrapper assembly which should wrap Aspose.Cells and expose itself as a COM object. Please research on internet how to create a .NET assembly which could expose itself as COM object.

Hope, this helps a bit.

Hi,

Thank you so much for your prompt response! Much appreciated!

I’m trying to use Aspose.Cells library not GridDesktop, I’m sorry for the confusion.
For Aspose.Words a wrapper is recommended as well but I still managed to get it work, therefore, I thought Aspose.Cells can work as well in VBScript via COM interop.

Thanks again for your response.

@ChaimBerger,
You are welcome.