Posted 8 September 2017, 1:36 pm EST
Hi. I would like to use custom cell names (eg <FONT size=2>FpSpread1.ActiveSheet.AddCustomName(</FONT><FONT color=#a31515 size=2>"CustNo"</FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2>"P1:P2000"</FONT><FONT size=2>, 0, 0)</FONT>) so that when referring to cells throughout my code I can say, eg
<FONT color=#0000cc>Dim expr As FarPoint.CalcEngine.ReferenceExpression
expr = FpSpread1.ActiveSheet.GetCustomName("CustNo")
column = expr.Column
CustNo = FpSpread1.ActiveSheet.Cells(e.Row, column).Value</FONT>
Then if I change the order of columns or add new ones via the bound dataset I only need to change the AddCustomName reference to make all code references to that column work.
However if I enable AllowColumnMove, the custom name does not keep up with the rearranged order when the user moves a column. Is it possible to automatically reassign CustomNames when the column are moved by the user?
Thanks. Hope thats clear.