Setting the Name.Comment property in German version of Excel seems to corrupt the name. Am I doing something wrong? Ideas how to fix?
The following code illustrates the issue
In English US version, this runs without any surprises.
But here's what happens when run in German version.
After the first line (I marked it 'ref1'), all looks good (watch window and Name manager screenshots)
but after going through the 2nd line, the references get messed up (they all change to German R1C1 format)
and then in line 3 I get a 1004 error (screenshot via Google translate!)
In line 4 and 5 it gets worse - I can't set the comment property even once.
In line 4, I set the reference to all cells, and it looks ok at this point:
but then in line 5 I get a 1004 error!
The following code illustrates the issue
VBA Code:
Sub testNameComment()
ActiveWorkbook.Names("n").RefersTo = Cells(1, 1) 'ref1
ActiveWorkbook.Names("n").Comment = "b" 'ref2
ActiveWorkbook.Names("n").Comment = "c" 'ref3
ActiveWorkbook.Names("n").RefersTo = Cells
ActiveWorkbook.Names("n").Comment = "a" 'ref4
End Sub
In English US version, this runs without any surprises.
But here's what happens when run in German version.
After the first line (I marked it 'ref1'), all looks good (watch window and Name manager screenshots)
but after going through the 2nd line, the references get messed up (they all change to German R1C1 format)
and then in line 3 I get a 1004 error (screenshot via Google translate!)
In line 4 and 5 it gets worse - I can't set the comment property even once.
In line 4, I set the reference to all cells, and it looks ok at this point:
but then in line 5 I get a 1004 error!