I have some vba code that places a UDF formula on a particular Range's FormulaArray property. Problem is the formula length can sometimes exceed 255 chars causing the code to fail. I posted this question at the MSDN forums here:
http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/ed7c5a4c-9fce-4f5b-8249-e588269179d2
(hoping some MSFT guy will lead me to a hot-fix that I never knew about)
Someone answered that this can be worked around using named ranges. I doubt that person is going to return to that thread anymore. So I'd like to ask the experts in this group to help me out here.
I don't quite understand the solution proposed in that thread (don't know if the values to the properties are right). Should we just do:
ActiveSheet.Names.Add Name:="SomeName"
RefersToR1C1:="=MyUDF(super_long_contents_of_formula)"
ActiveCell.FormulaArray = "SomeName"
??
http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/ed7c5a4c-9fce-4f5b-8249-e588269179d2
(hoping some MSFT guy will lead me to a hot-fix that I never knew about)
Someone answered that this can be worked around using named ranges. I doubt that person is going to return to that thread anymore. So I'd like to ask the experts in this group to help me out here.
I don't quite understand the solution proposed in that thread (don't know if the values to the properties are right). Should we just do:
ActiveSheet.Names.Add Name:="SomeName"
RefersToR1C1:="=MyUDF(super_long_contents_of_formula)"
ActiveCell.FormulaArray = "SomeName"
??