microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
113 stars 11 forks source link

Module names with numeric characters #55

Open KDean-Dolphin opened 1 year ago

KDean-Dolphin commented 1 year ago

I work for an organization whose name includes a numeric character. When I try to create a module with their name, the "New module" dialog works fine right up until the numeric character, when it shows "Name contains unexpected characters".

I need support for numeric characters in module names.

jack-williams commented 1 year ago

Does the organization name also happen to be a cell reference? This could be the issue as we prevent these as module names.

If the name is not a possible cell reference, then you should be able to create a module name.

image

One workaround would be to use an underscore between the letters and the number.

A cell reference cannot be the name for a named formula, and we have at least been trying to keep module names as legal range names. I do not know if we will be able to fix this, but I can leave this issue open.

KDean-Dolphin commented 1 year ago

Yes, it would be a legitimate cell reference (AAN).

Given that the final name published to NameManager would be AAN.FunctionName, such a module name should be acceptable. My existing functions are already in Name Manager in that format, so unless there's something in modules that I haven't noticed yet, I don't see a conflict.

jack-williams commented 1 year ago

We are trying to leave open the possibility of having syntax that references a module name only (in the same way you reference LET parameters). At this point, having cell reference module names might cause us some trouble.

For instance:

import Module = ....
import Module2 = ...

abc = Module.function(10);

I'll leave this open as an enhancement to get more feedback.