Consulting

Results 1 to 6 of 6

Thread: Drag & drop a file to automatically copy it to a destination folder

  1. #1
    VBAX Regular
    Joined
    Mar 2023
    Posts
    28
    Location

    Drag & drop a file to automatically copy it to a destination folder

    Hello again!

    I just wanted to thank you again for your help previously with regards to the filepath and destination issue I had before.

    It still works well and it has been well received by the staff.

    Their only gripe appears to be that they have to open up a browse dialogue in order to select a file and it then generates the filepath from it's existing location.

    What they would like to do, is to be able to drag and drop a file from anywhere, such as an attachment from an outlook email, onto the folder icon, which will then automatically copy to a destination folder, a "temporary holding area" lets say, which will then be copied again into the specified folder using the existing script which you helped with.

    Is this something you guys could, once again, help me with?

    Thank you in advance.

    I've attached my workbook so you can see what I mean.
    https://file.io/fUgkFPqAowHp
    Last edited by ecalid; 04-05-2023 at 07:18 AM.

  2. #2
    VBAX Mentor
    Joined
    Nov 2022
    Location
    The Great Land
    Posts
    332
    Location
    This has been asked and discussed numerous times in multiple forums. Have you searched?
    How to attach file: Reading and Posting Messages (vbaexpress.com), click Go Advanced below post edit window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    VBAX Regular
    Joined
    Mar 2023
    Posts
    28
    Location
    Thank you for your reply June7.

    I have had a good look around, I'm afraid I am just not that advanced when it comes to coding to be able to put together various modules etc.

    Also I'm not sure they do exactly what I need them to do.

    For example,

    Once the file has been dropped onto a userform, I need it to copy it to a destination folder, and then provide me with a filepath to it.

    But I'm struggling to find any like this?

  4. #4
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,223
    Location
    Perhaps you could use a little workaround using TreeView?

    It will will help getting the path of a dropped file, in the attached it changes the caption of Label1 when i file is dropped on the TreeView.
    Attached Files Attached Files
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2405, Build 17628.20102

  5. #5
    VBAX Regular
    Joined
    Mar 2023
    Posts
    28
    Location
    Quote Originally Posted by georgiboy View Post
    Perhaps you could use a little workaround using TreeView?

    It will will help getting the path of a dropped file, in the attached it changes the caption of Label1 when i file is dropped on the TreeView.
    Thanks Georgiboy, this is great however it doesn't accept attachments which are dragged from outlook emails, which is the primary function I need.

    Could this be adapted to incorporate such a function?

  6. #6
    VBAX Mentor
    Joined
    Nov 2022
    Location
    The Great Land
    Posts
    332
    Location
    How to attach file: Reading and Posting Messages (vbaexpress.com), click Go Advanced below post edit window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •