Select a range in Excel from a UserForm in AutoCAD

Select a range in Excel from a UserForm in AutoCAD

Anonymous
Not applicable
490 Views
2 Replies
Message 1 of 3

Select a range in Excel from a UserForm in AutoCAD

Anonymous
Not applicable
Hi,

I wish for the user to select a range half way through a procedure. What I
really want to do is create a userform with controls similar to that of the
charting tool or the goal seek in Excel. i.e.. a form where you can either
type in
the range or press a button (icon) and the procedure will wait for you to
select a range and press enter. I will need to select multiple ranges in my
form. I did not have much luck finding the right methods in the help files.
I have created a textbox where I plan to place the range and have created an
image button that I was hoping to assign some code to allow the user to
select a range.

Any assistance will be appreciated.

Regards

Sean
0 Likes
491 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Dear Sean,

Include a RefEdit control in your UserForm (reference it first) to select a
Range imitating the behavior of the reference edit boxes that are built
into Excel. See the Microsoft Knowledge Base Article nº 213776 or 158402:
http://support.microsoft.com/default.aspx?scid=kb;en-us;213776
http://support.microsoft.com/default.aspx?scid=kb;en-us;158402

Good luck!
Edson.
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi,

Cool, I have just learnt something new about the controls toolbox. I
actually managed to copy and paste the control from Excel to my AutoCAD
UserForm. At least now I know how to get it there directly.

Unfortunately I still cannot make it work. I have tried to place the
following code in the UserForm and still nothing happens.

Private Sub RefEdit1_BeforeDragOver(Cancel As Boolean, ByVal Data As
MSForms.DataObject, _
ByVal x As stdole.OLE_XPOS_CONTAINER, ByVal y As
stdole.OLE_YPOS_CONTAINER, _
ByVal DragState As MSForms.fmDragState, Effect As
MSForms.fmDropEffect, ByVal Shift As Integer)
Dim apExcel As Excel.Application
Set apExcel = GetObject(, "Excel.Application")
apExcel.Visible = True
apExcel.Windows("Test 1.xls").Activate
End Sub

Remember that I am placing this control in an AutoCAD UserForm and wnat to
select a range on an Excel spreadsheet.

Any assistance will be appreciated.

Thanks again.

Sean Bartleet



"Edson Luiz Branco" wrote in message
news:9DF1BECEC8E84A1A1DDDBD0D8F6FC295@in.WebX.maYIadrTaRb...
> Dear Sean,
>
> Include a RefEdit control in your UserForm (reference it first) to select
a
> Range imitating the behavior of the reference edit boxes that are built
> into Excel. See the Microsoft Knowledge Base Article nº 213776 or 158402:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;213776
> http://support.microsoft.com/default.aspx?scid=kb;en-us;158402
>
> Good luck!
> Edson.
>
>
>
>
0 Likes