Free Support Forum - aspose.com

AddCopy -Object reference not set to an instance of an object

Hi!
I'm trying to use the AddCopy method to copy a sheet in mt designer template, but I get a Object reference not set to an instance of an object Error. The sheet ha some validation lists and merged cells, but other than that nothing special.
If i try to copy a simpler sheet it works fine.

I have the latest version of the component.

The stacktrace is:

[NullReferenceException: Object reference not set to an instance of an object.] 
Aspose.Excel.Worksheet.a(Worksheet A_0)
Aspose.Excel.Worksheets.AddCopy(Int32 sheetIndex)
BL.ExcelUtility.CreateSheet() in C:\Projects\Customer\FMEA\1.0\BL\BL\ExcelUtility.vb:35
PL.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\FMEA\1.0\PL\WebForm1.aspx.vb:25
System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Regards,

Axel

Hi again…

When trying to make a workaround I get an error when I try to save the file:

Invalid formula:"=VLOOKUP(L5, ‘Set up’!$B$3: $C$7, 2, FALSE)*VLOOKUP(M5, ‘Set up’!$B$13: $C$16, 2, FALSE)*VLOOKUP(O5, ‘Set up’!$B$22: $C$26, 2, FALSE)*VLOOKUP(N5, ‘Set up’!$B$32: $C$35, 2, FALSE)".

If I copy/paste the formula into the template file manually it works fine.

/Axel

edit: I added spaces betweein : and $ to keep them from turning into emoticons…

Hi Axel,

Could you send your designer file to me by email? I will find what caused your problem of AddCopy method. About the formula problem, I will check it right now and report back later.

It’s fixed in hotfix 2.2.4. Please download it and have a try.

Thank you, it works fine!

You probably have the best and fastest customer support in the world!