|  
                                             
	Hallo Leute, 
	  
	ich schreibe grad ein Makro mit der ich Dateien auswähle, dann die 1.Tabellenblätter kopiere und dann als neue Dateien abspeichere. 
	Es funtkioniert einwandfrei, nur klappts mim schließen nicht, da bekomme ich eine Fehlermeldung dass der Index aus dem Gültigkeitsbereich ist. 
	Sub getDatei() 
	    Dim varFile As Variant 
	    Dim intDatei As Integer 
	    varFile = Application.GetOpenFilename(, , "Wählen Sie bitte die zu konvertierenden Dateien aus.", , True) 
	    If TypeName(varFile) Like "Boolean" Then 
	        MsgBox "Keine Datei ausgewählt!", vbInformation 
	        Exit Sub 
	    Else 
	        Workbooks("ASCII-Import-Gasspot.xlsm").Activate 
	        
	        For intDatei = 1 To UBound(varFile) 
	            Application.Workbooks.Open (varFile(intDatei)), Local:=True 
	            Cells.Copy 
	            Workbooks("ASCII-Import-Gasspot.xlsm").Sheets(1).Paste Destination:=Workbooks("ASCII-Import-Gasspot.xlsm").Sheets(1).Range("A1") 
	            Application.DisplayAlerts = False 
	            Sheets(1).SaveAs Filename:=Environ("UserProfile") & "\Desktop\" & intDatei & ".csv", FileFormat:=Excel.xlCSV, Local:=True 
	            Application.DisplayAlerts = True 
	           
	        Next intDatei 
	        
	        For intDatei = 1 To UBound(varFile) 
	            Application.Workbooks(varFile(intDatei)).Close True 
	        Next intDatei 
	           
	        MsgBox ("ASCII Umwandlung abgeschlossen, Dateien wurden abgesichert.") 
	        
	    End If 
	    
	End Sub 
     |