Thread: Deletefolder
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Deletefolder

You have to iterate through all the folders

Set FolderObj = fso.GetFolder("c:\" & tt & tal & kur1)
For each fldr in FolderObj.SubFolders
If fldr.name < "special" Then
fldr.delete
End If
Next fldr

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alvin Hansen" wrote in message
...
HI!

I use this:
fso.deletefolder "c:\" & tt & tal & kur1 & "\*.*"
its allright but if there are one folder i dosn't want to delete
how can i do that?

Befor the delefolder i have :

Set FolderObj = fso.GetFolder("c:\" & tt & tal & kur1) to see if there are
folders

Best regards alvin