Drag and Drop file to userform

ddosimoes

New Member
Joined
Nov 27, 2007
Messages
46
Hi,

I´m looking for some help in drag and drop in userforms or textbox. I built an application where the users have to choose a textfile to open. I´m using the "Application.GetOpenFilename" method but it would be much better if the users could drag and drop the file into the form.
Is there a way to capture the drag and drop of a file from windows explorer to a userform?
I´ve tried to use "BeforeDragOver" and "BeforeDropOrPaste" events but I can´t make it.
Unfortunately it seems that I should use "OLEDragDrop" event (present in VB6.0) but I don´t think it is in VBA possibilities.
I would appreciate any kind of help or even a path to get into it.

Regards,
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Daniel

I'm sure this could be possible.

But I'm also sure that it would be pretty/very complicated to do.

It would probably involve all sorts of things using the Windows API and other things, perhaps even 'taking over' the OS.:eek:
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top