Drag and Drop from Windows Explorer into Userform or Listbox

Fatchan

New Member
Joined
Aug 4, 2005
Messages
4
Hello,


I would like to create a macro that processes a bunch of excel files.

To determine which files should be processed, I want to create something like a listbox, into which I can drag files from windows explorer. When I am done adding the files I want to process, I want to iterate through the list of files and operate on them.

Can anyone provide me some help on how to write the code for the listbox?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I have found a relatively simple way to do this with a form in VB6, does anyone know a way to port from VB6 to VBA?
 
Upvote 0
I don't think this will be possible in VBA.

Why not just do the whole thing from VB6?

You can set a reference to the Excel library to access Excel objects/methods/properties.

Or how about using the GetOpenFileName method in VBA?
 
Upvote 0
Why not just do the whole thing from VB6?

You can set a reference to the Excel library to access Excel objects/methods/properties.

This would be an excellent way to do what I want, can someone show me what I need to do to reference the Excel Library?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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