The RefEdit control included with VBA is a bit erroneous, but it is good for placing a form when you want people to specify one or more ranges of cells (i.e. Excel.Range objects).
The main problem is that you can only use the RefEdit control in a custom VBA format ( Microsoft claims this , and my tests confirm this too). I am doing an Excel add-in using Delphi and I am looking for an alternative for the RefEdit control .
Excel.Application.InputBox Type:=8 is one of the alternative ways to select a range of cells, but it is not very user friendly when you need people to select multiple ranges of cells in one form. The best real alternative that I have at the moment is to call a VBA form from my Delphi add-in, but this is far from ideal.
Ideally, I could make a replacement for RefEdit, which I can use in Delphi form. If it is, it is not easy to find (I was looking pretty hard, and I could not find a RefEdit replacement for Delphi, VB6, or .NET).
In the event of a failed replacement, I can try to combine my own alternative, but I suspect that it would be difficult, if not impossible, to create one that works the same as RefEdit. RefEdit allows you to “select” cells without actually selecting them: it uses marching ants around your selected cells instead of selecting them and changing Excel.Application.Selection . I do not know how to do this by manipulating the Excel object model through VBA, Delphi, etc.
Any hints, tricks, hacks or, if I'm really lucky, pointers to replacing a RefEdit replacement would be most welcome.
source share