Silly me, of course the .count has to have put somewhere.
I had .refersto but did not think of R1C1
Thanks, works now.
But the same in vb.net via ExcelDNA does not work:
Dim tempRng As Range = SheetEquipment.Cells(2, 2)
Debug.Print(tempRng.Rows.Count)
Debug.Print(Wb.Names.Count)
Wb.Names.Add(Name:="Test", RefersTo:=tempRng)
'Wb.Names.Add(Name:="Test", RefersToR1C1:=tempRng)
'Wb.Names.Add(Name:="Test", RefersToR1C1:="=Equipment!Z2S2")
'Wb.Names.Add(Name:="Test", RefersToR1C1:="=Equipment!R2C2")
The counts both work (0 for wb.names.count and 1 for tempRng.Rows.Count) but none of the .Add statements.
What am I missing?
Bookmarks