Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have VBA code that copies various files from a Source location to a Destination folder. When ever a file is being saved by someone and the code tries to copy the file, I receive a message box indicating that "Permission Denied".

    When I click on "Ok", the code continues.

    Is there a way to wait for the file being saved prior to coping the file to the Destination folder?

    Thanks,
    John

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi John

    Does the string that identifies the path to the destination folder have a \ after it? If not try:


    destFol = "C:\" & Destination_Folder & "\"

    HTH
    Jerry

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='jstevens' post='795391' date='28-Sep-2009 18:38']Is there a way to wait for the file being saved prior to coping the file to the Destination folder?[/quote]

    Immediately after the Save command add the following command line

    DoEvents

    DoEvents passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent.
    Regards
    Don

Posting Permissions

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