We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Not enough elements in stack

I get the above error at sheet 28 of 38 when looping through every cell on every row of every sheet. My code is a utility to look for functions which are not provided by Syncfusion. System.ArgumentException was unhandled Message="Not enough elements in stack" Source="Syncfusion.XlsIO.Base" StackTrace: at Syncfusion.XlsIO.Parser.Biff_Records.Formula.FunctionVarPtg.PushResultToStack(Stack operands, String strDelimeter) at Syncfusion.XlsIO.Implementation.FormulaUtil.ParsePtgArray(Ptg[] ptgs, Int32 row, Int32 col) at Syncfusion.XlsIO.Implementation.RangeImpl.ParseFormula(FormulaRecord formula) at Syncfusion.XlsIO.Implementation.RangeImpl.get_Formula() at Syncfusion.XlsIO.Implementation.RangeImpl.GetStringValue() at Syncfusion.XlsIO.Implementation.RangeImpl.get_Text() at AllocationManager.TemplateAudit.btnGO_Click(Object sender, EventArgs e) in C:\My Local Documents\Talisman\PARS.NET\Apps\AllocationManager\TemplateAudit.vb:line 41 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at AllocationManager.TemplateAudit.Main() in C:\My Local Documents\Talisman\PARS.NET\Apps\AllocationManager\TemplateAudit.Designer.vb:line 2 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

9 Replies

AD Administrator Syncfusion Team April 3, 2006 03:06 PM UTC

We are looking into this issue.we will update you as soon as possible.Sorry for the inconvenience. Thanks, Bharath.


BJ Brian J. Burnett April 3, 2006 03:34 PM UTC

I think it is caused by the formula at the cell containing a function the is not in the list supported by Syncfusion or user define. The function at the cell causing the error is Column(). In order to write my own Column() function I need to know what cell is the current cell when ComputeCOLUMN is called. How do I find this? >We are looking into this issue.we will update you as soon as possible.Sorry for the inconvenience. > >Thanks, > >Bharath.


AD Administrator Syncfusion Team April 4, 2006 01:58 PM UTC

Hi Brian, I tried to reproduce the problem using this sample and trying to read the Coulumn formula present in cell A1 but was not able to reproduce the problem Here is the sample F42584UnknownFunction.zip I also noticed that we do support Column function but only supported uppercase version [COLUMN] which has been logged as a bug http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=1813 Could you please modify the above sample to show the problem? Thanks, Stephen. >I think it is caused by the formula at the cell containing a function the is not in the list supported by Syncfusion or user define. > >The function at the cell causing the error is Column(). In order to write my own Column() function I need to know what cell is the current cell when ComputeCOLUMN is called. How do I find this? > > >>We are looking into this issue.we will update you as soon as possible.Sorry for the inconvenience. >> >>Thanks, >> >>Bharath.


BJ Brian J. Burnett April 4, 2006 06:52 PM UTC

>Hi Brian, > >I tried to reproduce the problem using this sample and trying to read the Coulumn formula present in cell A1 but was not able to reproduce the problem > >Here is the sample > >F42584UnknownFunction.zip > >I also noticed that we do support Column function but only supported uppercase version [COLUMN] which has been logged as a bug > I don''t see it in the documentation or in the methods of calcengine. Are you saying it is a supported function it is just that the excel default of making function names uppercase means that calcengine does not detect it? I''ve had a look in the source can don''t see it there. If it does exist could you send it to me? >http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=1813 > >Could you please modify the above sample to show the problem? > >Thanks, > >Stephen. > >>I think it is caused by the formula at the cell containing a function the is not in the list supported by Syncfusion or user define. >> >>The function at the cell causing the error is Column(). In order to write my own Column() function I need to know what cell is the current cell when ComputeCOLUMN is called. How do I find this? >> >> >>>We are looking into this issue.we will update you as soon as possible.Sorry for the inconvenience. >>> >>>Thanks, >>> >>>Bharath.


BJ Brian J. Burnett April 5, 2006 06:59 AM UTC

>Hi Brian, > >I tried to reproduce the problem using this sample and trying to read the Coulumn formula present in cell A1 but was not able to reproduce the problem > >Here is the sample > >F42584UnknownFunction.zip > If you remove the arguement in the line which puts the formula into the sheet viz... sheet.Range["B1"].Formula = "COLUMN()"; Then add this line after the changed line above viz... string s = sheet.Range["B1"].Formula; This pulls the "Not enought elements in stack" error. As I reported orinionally it is reading the cell that causes the error not writing it as in example. It looks to me like the problem is that the formula parser assumes there must be an arguement. The Excel functions Column() and Row() do not require an arguement. In order to be able to code my own versions of Column and Row I need to be able to find out when cell contained the COLUMN() (or ROW()) function. How do I find this?


AD Administrator Syncfusion Team April 5, 2006 02:05 PM UTC

Hi Brian, Thanks for bringing this issue to our attention. I was able to reproduce your problem using the code given by you.I have filed a bug report regarding this issue,you can track this through the following link http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=1822. Here is a sample which will find the cell containing the COLUMN()and ROW() function.It will not find whether it is a ROW() or COLUMN() function. Please let me know if you need any further assistance. SAMPLE:ReadingFunctions.zip Thanks, Bharath.


AD Administrator Syncfusion Team April 5, 2006 02:22 PM UTC

Hi Brian, Sorry for sending broken link. Here is the attached sample. ReadingFunctions.zip Thanks, Bharath.


BJ Brian J. Burnett April 5, 2006 02:35 PM UTC

I''m afraid that your ReadingFunctions example is not the answer. The issue is that if the COLUMN() function is in a dependent cell of the cell being evaluated then the row, col address of the loop is not the reference to the COLUMN function. >Hi Brian, > >Thanks for bringing this issue to our attention. I was able to reproduce your problem using the code given by you.I have filed a bug report regarding this issue,you can track this through the following link http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=1822. > >Here is a sample which will find the cell containing the COLUMN()and ROW() function.It will not find whether it is a ROW() or COLUMN() function. > >Please let me know if you need any further assistance. > > >SAMPLE:ReadingFunctions.zip > >Thanks, > >Bharath. >


AD Administrator Syncfusion Team April 6, 2006 01:25 AM UTC

Hi Brian, Sorry for the confusion in getting this issue resolved. I am afraid I am unable to understand the exact problem so could you please clarify the following to ensure that this issue gets resolved quickly 1) Are you using the calculation engine and xlsio together? 2) Could you please provide a sample that would demonstrate your exact requirements. We will try our best to get this issue resolved soon. Thanks, Stephen.

Loader.
Live Chat Icon For mobile
Up arrow icon