When I try to copy the "report" sheet from the attached template to a new workbook, I receive the following error.
System.NullReferenceException: Object reference not set to an instance of an object. at Aspose.Cells.ಐ.ন(ಐ ) at Aspose.Cells.Cell.ు(Cell ) at Aspose.Cells.Cells.ন(Cells ) at Aspose.Cells.Worksheet.ন(Worksheet , Boolean ) at Aspose.Cells.Worksheet.Copy(Worksheet sourceSheet) at WindowsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\jrozier\My Documents\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\Form1.vb:line 18
Code:
Dim x As New Aspose.Cells.Workbook Dim y As New Aspose.Cells.Workbook
Well, currently there is a problem with Copy method, so you should not use it for the time being till it is resolved. I think you may try: open your template workbook (having your required sheets), save it as to create a new one.
Unfortunately, I can't use that work-around. I need multiple copies of the sheet being copied and I need VBA in the resulting report that I'm pulling from another template. Worksheet.Copy works with some of my templates. I've attached one. Is there something specific about the templates that caused the failure that I can modify? I'm supposed to deploy to production this Friday and need something soon.
In this fix,we use Cell.GetStyle and SetStyle method replace the property of Cell.Style. The two methods will save more memory usage than cell.Style property. The feature caused that we could not response quickly.
If you want to set style of the cell, please change your codes as :
This fixes the issue stated above, but the Cells.Rows property is missing and the Row type is missing. Also, Worksheets.GetNamedRanges fails with an Index out of range error.
We did change some internal structure of the Aspose.Cells component related formattings. We have to sacrifice this for some optimization and performance measures and did eliminate / modify some APIs which we have now in more enhanced shape. You may utilize some newer APIs of Cells class instead e.g.., ApplyRowStyle() etc. We will soon publish an article for the users to list the deprecated apis and the newer ones for the replacement.
For Worksheets.GetNamedRanges() method, we don't find the problem as I tested, Could you give us some sample code with template file to re-produce the issue. We will check it soon.