Free Support Forum -

'Invalid external reference to a worksheet' on save as in browser


I have a very strange problem; when a workbook ( generated by aspose cells) is opened in the browser, and then 'save as' I get the error 'Your formula contains an invalid external reference to a worksheet', but there is no external reference in the workbook. I tried to trace the problem, but it's very hard to find. In a small test project the problem seems to disappear if I copy everthing into a new worksheet.( in the template file) Tried to do the same with the very big worksheet in my real project but the problem keeps coming back. The very strange part now ; in attach 2 files ; 'TestTPA.xlt' exactly the same as 'TestTNPA.xlt' but in 'TestTPA.xlt some data falls beneath the printing area. No problems with 'TestTNPA' but the other one gives the above error. I only open the file ( with aspose cells), and save it back again with a new name ( for my testproject )

I'm using, VB.Net on Asp.Net 2


Hi Luc,

When you open "TestTNPA.xlt" in MS Excel, you will get the same error. Is this file created with Aspose.Cells? I don't think so.

No , the template file is not created with aspose cells. It's created in MS Excel. I see indeed that when you doubleclick on it, you get the same message in excel. But if you open it as template no problem. It's only a very small part of a big excel workbook trying to trace the problem. When using the template file in VB6, with excel automation no problem. When using it in with aspose cells I get the error. The strange thing is that "TestTNPA.xlt' works fine. 'TestTPA.xlt' is exactly the same, I only changed the printing area ( in excel). Maybe excel does corrupt something when changing the printing area, and/or there's something wrong with the template that usualy doesn't show up.

I did now a test with another big , similar template file and that one is ok. ( but I stil have no idea what's wrong with the other one )


Hi Luc,

I am sorry I didn't provide the correct information.

1. I opened your two template files in MS Excel and TestTNPA.xlt works fine but I meet the "Invalid external reference..." problem when opening TestTPA.xlt.

2. Could you post your sample code and output file with Aspose.Cells here?

Generally I think it's a problem of your template file.

Hello Laurence,

I guess there was indeed something wrong with the excel template. I've ran a microsoft repair tool on it, and now everything works fine. Probably something that only shows up in some special cases.

Never mind, everything is ok now. ( and now I know there exist tools that check excel files that behave strange ...)