Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
 

Const WM_SETTEXT As Long = &HC


    Dim hwndMain As Long
    Dim hwndEdit As Long
    Dim path As String
    
    ThisWorkbook.Activate

    ' パス
    path = "C:\Users\user\"
    ' 親ウィンドウを取得
    hwndMain = FindWindow("#32770", vbNullString)
    ' コントロールハンドルを取得
    hwndEdit = FindWindowEx(hwndMain, 0, "Edit", vbNullString)
    ' toolbarwindow32にパスいれる
    Call SendMessage(hwndEdit, WM_SETTEXT, 0, ByVal path)