seltsam, plötzlich fehler!
28.01.2009 11:05:03
adrian
habe lediglich den syntax ein bisschen erweitert und plötzlich kommt eine Fehlermeldung:
The maro 'ODM-OEM-affairs.xls!Module1.LoadComboBoxesSonyUS' cannot be found!
habe die Excel Datei auch umbenannt. kann es daran liegen? Zuvor Trial.xls
lg
adrian
Private Sub CommandButton2_Click()
Dim i As Integer
i = ComboBox1.ListIndex
If ComboBox1.Value "" Then
For Each Objekt In Worksheets("Sony (US)").OLEObjects
If InStr(Objekt.Name, ComboBox1.Value) Then Objekt.Delete
Next Objekt
End If
With ComboBox1
If .ListIndex >= 0 Then
.RemoveItem (.ListIndex)
.Value = ""
Range("L70").Offset(0, i).Clear
Range("L71").Offset(0, i).Clear
Range("L72").Offset(0, i).Clear
Range("L73").Offset(0, i).Clear
Range("L74").Offset(0, i).Clear
Range("E70").Offset(i, 0).Clear
Range("F70").Offset(i, 0).Clear
End If
End With
Application.Run ThisWorkbook.Name & "!Module1.LoadComboBoxesSonyUS"
End Sub
Fkt. im Module1 Cell ist außerhalb deklariert, da es mehrere LoadComboBox Fkt. in dem Modul gibt.
Sub LoadComboBoxesSonyUS()
With ActiveSheet.ComboBox1
.Clear
For Each Cell In Range("SonySupplierUS")
.AddItem Cell.Value
Next
End With
With ActiveSheet.ComboBox2
.Clear
For Each Cell In Range("SonySupplierUS")
.AddItem Cell.Value
Next
End With
End Sub
Das habe ich erweitert: Falls es eine Rolle spielen sollte.... (das fett markierte)
Private Sub CommandButton1_Click()
Dim i As Integer
SpecialChr = ""
With ComboBox1
For i = 33 To 47
If InStr(.Value, Chr(i)) Then SpecialChr = "Found"
Next
If SpecialChr = "Found" Then
MsgBox "Please do not enter special characters like:" & " /" & " ," & " +" & " ." & " -" & _
" !" & vbNewLine & _
vbNewLine & "Please read yellow info!"
Else
.AddItem .Value
.Value = ""
.SetFocus
End If
End With
End Sub