Free Support Forum - aspose.com

Get exception when running on 64 bit[URGENT]

Hello,

When i run my application on 64 i get error stating “Attempted to read or write protected memory. This is often an indication that other memory is corrupt”. On 32 bit clients it seems to work fine. I have tried the latest version too. Please help me as soon as possible as our clients are waiting for this?

Thanks in advance
AZ

Hi,

Well, if you have installed Aspose.Cells for .NET component using Aspose.Cells.msi installer, there will be two dlls on the installation path. You may use the dll in the NET2.0 folder for 64 bit machine. Please see the following documentation link for your reference.

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/using-aspose-cells-component-on-32bit-and-64bit-platforms.html

You may also check the following links which may help you regarding use of DLL and referring them in your project.

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/installing-aspose-cells-for-net.html

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/referencing-aspose-cells-component-from-a-net-project.html

Also, I have attached the latest DLL which can be used with 64 bit machine. If you need any further assistance, please do let us know. We will be happy to help you out.

Thank You & Best Regards,

Hi,

As per our discussion of the live chat, you find this issue for 64bit environment only for the sample code

for (int i = 0; i < this.NumberOfCopies; i++) {

this._oAsposeWorksheet.SheetToPrinter(sPrinterName); //this line gives the error.

}


One thing you got to make sure that you are using the right version of the product, you should use the Aspose.Cells.dll library from .NET2.0 folder for 64bit environment, see the document for reference: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/using-aspose-cells-component-on-32bit-and-64bit-platforms.html

Also, we will investigate your issue to simulate your 64bit environment on our end, we will get back to you soon.

Thank you.

Hi,

Moreover, in the attached version provided by Nausherwan, we have introduced SheetRender API and you should use it for Sheet2Printer feature.

Sample code:

//…
foreach (Worksheet ws in wbk1.Worksheets)
{

ImageOrPrintOptions image = new ImageOrPrintOptions();



image.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;



SheetRender sr = new SheetRender(ws, image);





for (int i = 0; i < sr.PageCount; i++)
{



sr.ToPrinter(“Microsoft XPS Document Writer”);



}



}


Thank you.