Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

Commented Unassigned: Excel: Names.Add Method [22164]

$
0
0
Hi Sebastian,

while I was trying to add names automatically i discovered the following:

If I add a name in VBA i always have to use the english formula (in the RefersTo parameter; as described under https://msdn.microsoft.com/de-de/library/office/ff835300.aspx the formula needs to be in english).

Example: I want to add a formula in german "=BEREICH.VERSCHIEBEN(A1;0;0;10;1)". To add this formula automatically via VBA i would write something like

```
Sub example()
ActiveWorkbook.Names.Add Name:="name", RefersTo:="=Offset($A$1,0,0,10,1)"
End Sub
```

a new name "=BEREICH.VERSCHIEBEN(Tabelle1!$A$1;0;0;10;1)" is created in my Workbook (I have a german installation).

However, this doesn't work with NetOffice. I tried 2 versions.

1. This one simply crashes with an error that says that this is not a correct formula
```
ActiveSheet.Names.Add("name", "=Offset($A$1,0,0,10,1)");
```

2. Replaced "," with ";"
```
ActiveSheet.Names.Add("name", "=Offset($A$1;0;0;10;1)");
```

This results in a new name with the formula "=Offset($A$1;0;0;10;1)" but of course my german version does not know "offset".

So i guess that there is some sort of translation from the english formula version to your local language which is currently nut supported by NetOffice. Couly you please have a look? Happy to provide additional details if needed.

regards,

coheedld
Comments: ** Comment from web user: coheedld **

Error message of option 1 as described above.


Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>