![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 1
|
In my application I have to use a folder temporary (thus called TEMP). After use I like to delete this folder.
Is it possible in Excel VBA to create and delete a file folder? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi
Which version of office are you using? Tom |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Wellington
Posts: 104
|
Hi,
You can try using the following: to create folders: mkdir "C:temp" and to delete folders: rmdir "c:temp" HTH |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
has files in them....you can do this though Sub RemoveDir_WithFiles() Dim Fs As Object On Error GoTo DelErr 'CAUTION: Will delete entire Folder NO PROMPT Set Fs = CreateObject("Scripting.FileSystemObject") Fs.DeleteFolder "C:mydir", True Exit Sub DelErr: MsgBox Err.Number & vbCr & _ Err.Description End Sub Ivan |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|