Public Sub Main() Dim folder As String Dim eraseShapefile As String Dim vystupFol As String folder = "E:\ProgramovaniVGeoinformatice\cv7\zprac" eraseShapefile = "E:\ProgramovaniVGeoinformatice\cv7\jmkraj.shp" vystupFol = "E:\ProgramovaniVGeoinformatice\cv7\vystup" FindFile folder, "*.shp", eraseShapefile, vystupFol MsgBox "Finished" End Sub Private Sub FindFile(inFol As String, sFile As String, shp As String, vystup As String) 'Rutina FindFile prochazi zadany adresar (Promenna inFol) a hleda v nem soubory obsahujici retezec zadany v promenne sFile (typicky pripona souboru) 'pro vyhledane soubory pak spousti jednotlive procedury a funkce prevodu 'finding files Dim FSO As FileSystemObject Dim curFolder As folder Dim sFileName As String Set FSO = New FileSystemObject Set curFolder = FSO.GetFolder(inFol) 'Get first file matching pattern sFileName = Dir(FSO.BuildPath(curFolder.path, sFile), vbNormal Or vbHidden Or vbSystem Or vbReadOnly) 'Dim name As String 'Dim inPath As String 'Loop through all files returned While Len(sFileName) <> 0 'pustit funkci Intersect inFol & "\" & sFileName, shp, vystup & "\" & sFileName 'Get next file matching pattern sFileName = Dir() DoEvents Wend End Sub Public Sub Intersect(inputdata1 As String, inputdata2 As String, outputdata As String) ' Create the Geoprocessor object Dim GP As Object Set GP = CreateObject("esriGeoprocessing.GPDispatch.1") ' Load required toolboxes... GP.AddToolbox "C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx" ' Process: Intersect... GP.Intersect_analysis inputdata1 & ";" & inputdata2, outputdata, "ALL", "", "INPUT" End Sub