da kommt dann immer ein fehler

Code:
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Const GW_HWNDFIRST = 0: Const GW_HWNDLAST = 1: Const GW_HWNDNEXT = 2: Const GW_HWNDPREV = 3: Const GW_OWNER = 4: Const GW_CHILD = 5

Private Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" _
 Alias "FindWindowExA" (ByVal hWndParent As Long, _
 ByVal hWndChildAfter As Long, ByVal lpszClass As String, _
 ByVal lpszWindow As String) As Long



Private Sub Command1_Click()
thunderformdc = FindWindow(vbNullString, "Editor.txt - Editor")
shellembedding = FindWindowEx(thunderformdc, 0&, "shell embedding", vbNullString)
shelldocobjectview = FindWindowEx(shellembedding, 0&, "shell docobject view", vbNullString)
internetexplorerserver = FindWindowEx(shelldocobjectview, 0&, "internet explorer_server", vbNullString)
hwn = Editor.txt - Editor
Me.SetFocus
ie.SetFocus
Call PostMessage(hwn, WM_KEYDOWN, vbKeyTab, &H0)
Call PostMessage(hwn, WM_KEYDOWN, vbKeyTab, &H1)
Call PostMessage(hwn, WM_KEYDOWN, vbKeyTab, &H2)
Call PostMessage(hwn, WM_KEYDOWN, vbKeyTab, &H2)
Call PostMessage(hwn, WM_KEYDOWN, vbKeyReturn, &H0)


End Sub
Also ein Laufzeitfehler