PDA

View Full Version : Problem with deleting files



ccRider246
02-11-2010, 04:58 PM
I have created a pricing program that runs completely on user forms. When the file is opened it opens to a userform that prompts users through the process of creating projects and making quotes within the projects. When the workbook is opened a directory structure is created and in that structure is a folder called Projects. When the user creates a new project a folder is created under Projects that has a project name. That is a unique name so that no two projects can have the same name. Multiple files are created within this project folder to save discounts, tax rates, quote numbers, the quotes themselves, and a description of the quote. The problem I am experiencing is that I have a procedure to allow a user to delete a project. All works well with the deletion of the files and folder but there is one snafu. While the program is actively running, if a project called "XYZ" is deleted, the user cannot create another project called "XYZ" because even though the folder has been deleted, the directory still retains the name in memory and throws a run-time error 75. If my user form is closed and reopened there is no problem creating a new project with the old project name. So my question is this...is there a way to refresh the file directory an purge those deleted names from memory so that they can be reused without closing the user form? You are probably going to ask for a sample. If oyu do I can mock up something in a few days and repost but if someone happens to understand my problem from this and can offer a solution, it would be greatly appreciated. Athough I am using Windows 7 and Excel 2007, I am programming for clients using XP and 2003.