Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default DataObject in BeforeDragOver has no format

I have a VBA form which has a listbox. When dragging a file, folder or
computer from Explorer to the list box, in the BeforeDragOver event
handler, calling GetFormat on the DataObject always returns false.
What am I doing wrong? My code follows. It is just trying to determine
what format values different DataObjects supoort.

Thanks in advance for any help.

-John

Private Sub lstMachines_BeforeDragOver(ByVal Cancel As
MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As
Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState,
ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
Dim bRes As Boolean
Dim i As Long
For i = -32767 To 32767
bRes = Data.GetFormat(i)
If (bRes) Then
MsgBox "Format " & i
End If
Next i
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default DataObject in BeforeDragOver has no format

The MSForms.DataObject only supports text, according to "What is the
difference between the DataObject and the Clipboard" in help.

Regards,
Peter T

"John Shell" wrote in message
...
I have a VBA form which has a listbox. When dragging a file, folder or
computer from Explorer to the list box, in the BeforeDragOver event
handler, calling GetFormat on the DataObject always returns false.
What am I doing wrong? My code follows. It is just trying to determine
what format values different DataObjects supoort.

Thanks in advance for any help.

-John

Private Sub lstMachines_BeforeDragOver(ByVal Cancel As
MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As
Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState,
ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
Dim bRes As Boolean
Dim i As Long
For i = -32767 To 32767
bRes = Data.GetFormat(i)
If (bRes) Then
MsgBox "Format " & i
End If
Next i
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default DataObject in BeforeDragOver has no format

Thanks, Peter.

-John

On Fri, 1 Sep 2006 20:59:10 +0100, "Peter T" <peter_t@discussions
wrote:

The MSForms.DataObject only supports text, according to "What is the
difference between the DataObject and the Clipboard" in help.

Regards,
Peter T

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error using DataObject to get clipboard data stocktsi Excel Discussion (Misc queries) 4 April 29th 09 02:54 PM
DataObject Error in Excel version 2002 PT_VBA_GRRL Excel Programming 1 December 27th 05 10:25 PM
How do I reference "DataObject"? Carl[_7_] Excel Programming 1 March 14th 05 06:27 AM
DataObject and cliboard D.2 Excel Programming 5 January 22nd 05 08:00 PM
Can't Dim As DataObject?? Ed[_9_] Excel Programming 3 January 12th 04 09:35 PM


All times are GMT +1. The time now is 04:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"