Hi,
I am trying to develop some drag-n-drop interface for schedules which is easy to operate and updates actual dates in a table.
so far I managed to move an Image ActiveX control, using mouseUp and MouseDown events of the image (and copying massively from this post)
however, I am facing difficulties even storing an ActiveX Label control into a variable 
the code below works, but if I define lb as Label, it says "Type mismatch"
defined as "variant" it all works fine, but when I try to change the label position an error appears saying that this object does not support such property 
'2015-04-02 / B.Agullo /
Public Sub Test()
'description here
Dim s As Image
Dim rg As Range
Dim lb As Variant
Dim sX As shapeX
Static LastTime!
SHAPESws.Range("_execute") = 1
Set s = SHAPESws.Image1
Set lb = SHAPESws.OLEObjects("Label1").Object
Set rg = Worksheets("ranges").Range("A1")
Set sX = createShapeX(s:=s, lb:=lb, rg:=rg)
Do
If Timer >= LastTime! + 0.5 Then
End If
DoEvents
Loop While SHAPESws.dragAndDropTGL
End Sub
Private Sub StartLoop()
Dim pt As POINTAPI
Do Until StopLoop
Call GetCursorPos(pt)
pt = ScreenPixelsToWorkSheetPoints(pt)
With sh
.Left = pt.x
.Top = pt.y
End With
With lb
.Left = pt.x '<---- here is when the error appears...
.Top = pt.y
End With
DoEvents
Loop
End Sub
feel free to try the same file I am working on superShape.xlsm
Bookmarks