+ Reply to Thread
Results 1 to 3 of 3

BUG! VBA MKDIR folders cannot be deleted

  1. #1
    Registered User
    Join Date
    09-30-2014
    Location
    Netherlands
    MS-Off Ver
    Windows 7
    Posts
    13

    Exclamation BUG! VBA MKDIR folders cannot be deleted

    I have a problem with the following code:


    Please Login or Register  to view this content.
    The code works fine, and creates the folders as i want to (on the folders of my companies server), but for (only a few) folders it is impossible to delete them afterwards. (not even via cmd).
    When I try to delete it an error pops up: "Could not find this item". And when I select Properties-> security of the folder is says : "The requested security information is either unavailable or can't be displayed".

    Is there someone around who had this simular problem?

    Thanks!


    NOTE: I tried addind a time delay of 1 second because i thought the sub-folders were created to soon. This doesnt change a thing however.

  2. #2
    Registered User
    Join Date
    02-20-2014
    Location
    Devon, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: BUG! VBA MKDIR folders cannot be deleted

    Hi,

    Very late to the party but I have encountered exactly the same symptoms that have taken a while to determine what the issue is.

    It turns out that VBA can create folders with trailing spaces in the folder name but this plays havoc with Windows.

    I have got to the stage where I have encountered the problem, identified the cause, can fix the code to trim any folder names (these are generated by my code by can be over-ridden by the user - where the introduction of the trailing spaces have occurred), but as yet still can't delete the folders that have been created. If I find a solution I'll repost here.

    Hope this helps anyone else that encounters this.

    John

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    Devon, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: BUG! VBA MKDIR folders cannot be deleted

    Seems to be plenty about deleting files/folders with trailing spaces on the web but thought I'd add the information anyway as promised.

    You can remove these 'rogue' folders with VBA using the RmDir command and with the folder path in 8.3 notation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mkdir - Create folders from Excel list
    By swmasson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-13-2016, 05:23 PM
  2. [SOLVED] Create folders and Sub folders and Sub-Sub folders from 5 columns with VBA
    By arleutwyler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-11-2014, 04:16 PM
  3. MkDir not working
    By pprseller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2009, 12:47 PM
  4. [SOLVED] MKDir not working
    By Robert_L_Ross in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2006, 02:20 AM
  5. [SOLVED] Retrieving Deleted Folders
    By Smik60 in forum Excel General
    Replies: 1
    Last Post: 06-07-2006, 04:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1