Ich weiß nicht...
hier noch mal der aktuelle Code....
Private Sub cmdBTOK_Click()
Dim iPages As Integer
Dim iTmp As Integer
Dim iTmp2 As Integer
Dim iZaehler As Integer
Dim iLength As Integer
Dim strTmp As String
Dim strTmp2 As String
Dim strFileName As String
Dim wrkBookNeu As Workbook
Dim wrkBookOrg As Workbook
If txtBoxUserName.TextLength < 1 Then
MsgBox ("Kein Username eingegeben!")
GoTo cmdBTOK_Click_Ende
End If
If txtBoxUserPasswort.TextLength < 1 Then
MsgBox ("Kein Passwort eingegeben!")
GoTo cmdBTOK_Click_Ende
End If
If txtBoxServer.TextLength < 1 Then
MsgBox ("Kein Datenbankserver eingegeben!")
GoTo cmdBTOK_Click_Ende
End If
Application.DisplayAlerts = False
Set wrkBookOrg = Application.ActiveWorkbook
iPages = ActiveWorkbook.Worksheets.Count
For iTmp = 1 To iPages
Set wrkBookNeu = Application.Workbooks.Add
Do While (wrkBookNeu.Worksheets.Count > 1)
wrkBookNeu.ActiveSheet.Delete
Loop
wrkBookOrg.Sheets(iTmp).Copy after:=wrkBookNeu.Sheets(1)
wrkBookNeu.Sheets("Tabelle3").Delete
strFileName = wrkBookNeu.ActiveSheet.Name
iLength = Len(strFileName)
For iZaehler = 1 To iLength
'Überprüfung der einzelnen Zeichen
strTmp = Mid(strFileName, iZaehler, 1)
If strTmp < Chr$(33) Then
strTmp = "_"
End If
If strTmp = "<" Or strTmp = ">" Or strTmp = "/" Or strTmp = "\" Then
strTmp = "-"
End If
strTmp2 = strTmp2 + strTmp
strTmp = ""
Next iZaehler
'iwrkBookNeu.SaveAs(strTmp2, xlCSV)
wrkBookNeu.Close
strTmp2 = ""
strTmp = ""
Next iTmp
Application.DisplayAlerts = True
End
cmdBTOK_Click_Ende:
End Sub
Bei iwrkBookNeu.SaveAs(strTmp2, xlCSV) hängt er sich immer auf...