Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default maybe to bob phillips -next folder?

Hi
I use this code:
Set fso3 = CreateObject("Scripting.FileSystemObject")
Set folderobj = fso3.GetFolder("c:\" & tt & tal & kur1)
For Each fldr In folderobj.subFolders

For Each file In fldr.Files
myattr = file.Attributes
If myattr = 33 Then
ind = MsgBox("Filen " & file.name & " er skrivebeskyttet skal den slettes?
", vbOKCancel)
If ind = vbOK Then
fso3.deletefile file, True
End If
Else
fso3.deletefile file
End If
Next file
fldr.Delete force:=True
Next fldr

well its working but if i have a folder and in this have anew folder with a
file read only i dont get to the file?

Regards alvin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default maybe to bob phillips -next folder?

Hi Alovin,

If you want to check folders in a folder as well, you could add an
independent loop

For Each fldr2 in fldr.SubFolders
'etc
Next fldr2

--

HTH

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


"Alvin Hansen" wrote in message
...
Hi
I use this code:
Set fso3 = CreateObject("Scripting.FileSystemObject")
Set folderobj = fso3.GetFolder("c:\" & tt & tal & kur1)
For Each fldr In folderobj.subFolders

For Each file In fldr.Files
myattr = file.Attributes
If myattr = 33 Then
ind = MsgBox("Filen " & file.name & " er skrivebeskyttet skal den slettes?
", vbOKCancel)
If ind = vbOK Then
fso3.deletefile file, True
End If
Else
fso3.deletefile file
End If
Next file
fldr.Delete force:=True
Next fldr

well its working but if i have a folder and in this have anew folder with

a
file read only i dont get to the file?

Regards alvin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default maybe to bob phillips -next folder?

Hi bob
Thanks.

regards alvin


"Bob Phillips" skrev:

Hi Alovin,

If you want to check folders in a folder as well, you could add an
independent loop

For Each fldr2 in fldr.SubFolders
'etc
Next fldr2

--

HTH

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


"Alvin Hansen" wrote in message
...
Hi
I use this code:
Set fso3 = CreateObject("Scripting.FileSystemObject")
Set folderobj = fso3.GetFolder("c:\" & tt & tal & kur1)
For Each fldr In folderobj.subFolders

For Each file In fldr.Files
myattr = file.Attributes
If myattr = 33 Then
ind = MsgBox("Filen " & file.name & " er skrivebeskyttet skal den slettes?
", vbOKCancel)
If ind = vbOK Then
fso3.deletefile file, True
End If
Else
fso3.deletefile file
End If
Next file
fldr.Delete force:=True
Next fldr

well its working but if i have a folder and in this have anew folder with

a
file read only i dont get to the file?

Regards alvin




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
For Bob Phillips D.J.Shaw Excel Worksheet Functions 5 August 3rd 05 01:20 AM
To: Bob Phillips Metallo[_4_] Excel Programming 3 July 14th 04 07:43 PM
Bob phillips?? gav meredith[_2_] Excel Programming 1 April 20th 04 01:41 PM
Bob Phillips Mickey[_3_] Excel Programming 1 March 5th 04 08:46 PM
Bob Phillips boblauder[_2_] Excel Programming 2 January 21st 04 03:28 PM


All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"