Hi Faraz,
Before I try to reproduce your problem, could you perhaps explain how
the .NET InputBox is "not working out perfectly"?
* Is the InputBox displayed?
* Is the result of the InputBox a Range object?
Some related links that you might be useful, where the RefEdit control
has been re-implemented in .NET:
*
http://www.codeproject.com/Articles/32805/RefEdit-Emulation-for-NET
*
http://www.codeproject.com/Articles/34425/VS-NET-Excel-Addin-Refedit-Control
*
http://www.breezetree.com/blog/index.php/excel-refedit-in-c-sharp/
If you try any of these, please let us know what you find. I've not
had a closer look myself.
Regards,
Govert
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
Ensure that the Excel-DNA project continues by
making your donation -
http://excel-dna.net/support/
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
On Apr 27, 8:03 pm, Faraz Ahmed Qureshi <
farazem...@gmail.com> wrote:
> Hi Govert,
>
> Sure have found the experiments going on excellent and making me a fan of
> an ideal programmer like you and fellows on this great forum buddy.
> However, not finding any good or proper source in respect of selecting
> ranges for a TextBox on form in absence of an integrated control of
> RefEdit. In Excel I can use the native imputbox as in the following code to
> represent the selection address:
>
> Sub SelectionTest()
> Dim SelectedAddress As Range
> On Error Resume Next
> Set SelectedAddress = Application.InputBox("Select your desired cells.",
> , , , , , , 8)
> If SelectedAddress Is Nothing Then
> MsgBox "No valid range was selected!"
> Else
> MsgBox "You selected " & SelectedAddress.Cells.Count & " cell(s)."
> End If
> End Sub
>
> However, now in Visual Studio, what would be the proper way to return the
> similar address/reference to cells. Consider the following example yet
> worked out on back of a form to return the selection's address to a TextBox
> named *ListAddress* by pressing a button named *Button3*, but not working
> out perfectly:
>
> Private Sub Button3_Click(sender As System.Object, e As System.EventArgs)
> Handles Button3.Click
> ListAddress.Text = SelectionTest()
> End Sub
>
> Function SelectionTest()
> Dim SelectedAddress As Object
> On Error Resume Next
> SelectedAddress = ExcelDnaUtil.Application.InputBox("Select your
> desired cells.", , , , , , , 8)
> If SelectedAddress Is Nothing Then
> SelectionTest = ""
> Else
> SelectionTest = "'" & SelectedAddress.Parent & "'!" &
> SelectedAddress.Address
> End If
> End Function
>
> What would be your valuable suggestion in this regard?
>
> Thanx again,
>
> Your ever-admiring fan,
>
> Faraz A Qureshi