- Katılım
- 2 Mart 2005
- Mesajlar
- 2,960
- Excel Vers. ve Dili
-
ev: Ofis 2007- Win Xp
iş: Ofis 2010- Win Vista
Merhabalar;
http://www.excel.web.tr/showthread.php?t=45766
yukarıdaki linkte sn. zeki hocamızın yapmış olduğu kodlarda kdları tek prosodürde toplamak için düzenleme yapmak istediğimde AltListem alt prosodüründe (goSub) kırmızı satırı kullanınca belli bir süre sonra next satırında hata veriyor sebebi nedir?
http://www.excel.web.tr/showthread.php?t=45766
yukarıdaki linkte sn. zeki hocamızın yapmış olduğu kodlarda kdları tek prosodürde toplamak için düzenleme yapmak istediğimde AltListem alt prosodüründe (goSub) kırmızı satırı kullanınca belli bir süre sonra next satırında hata veriyor sebebi nedir?
Kod:
Sub SubHsr_KlasorIceriginiListele()
Dim klsrSec, klsrAra, klsrLst As Object, klsrMsUstu$
Dim dosya, yol As String, i, j As Long
Set klsrSec = CreateObject("Shell.Application").BrowseForFolder(0, "Lütfen bir klasor seçin !", 1)
klsrMsUstu = CreateObject("WScript.Shell").SpecialFolders("Desktop")
If klsrSec = "Masaüstü" Or klasor = "Desktop" Then
yol = klsrMsUstu
GoSub AnaListem
GoSub AltListem
ElseIf klsrSec <> "Masaüstü" Then
yol = klsrSec.Items.Item.Path
GoSub AnaListem
GoSub AltListem
Else
Exit Sub
End If
Set klsrSec = Nothing
Set klsrLst = Nothing
Exit Sub
AnaListem:
Cells.ClearContents
dosya = Dir(yol & "\*.*")
i = 1
While dosya <> ""
DoEvents
i = i + 1
Cells(i, 1) = yol & dosya
dosya = Dir
Wend
Return
Exit Sub
AltListem:
Set klsrLst = CreateObject("Scripting.FileSystemObject").GetFolder(yol).SubFolders
On Error GoTo sonraki
For Each klsrAra In klsrLst
dosya = Dir(klsrAra.Path & "\*.*")
While dosya <> ""
DoEvents
j = [a65000].End(3).Row + 1
Cells(j, 1) = yol & "\" & dosya
dosya = Dir
Wend
'MsgBox yol
[COLOR=red][B]yol = klsrAra.Path: GoSub AltListem[/B][/COLOR]
'AltListe (klsrAra.Path)
sonraki:
Next
Return
End Sub

Son düzenleme: