Hi all,
I have written small program with VBA in Excel, and try to use API function - "SendMessage". However, I do not know why generate error message - "Complie Error: method or data member not found" when the program is running. Could anybody help me to solve it. Below statements I wrote as:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As _
Long, lParam As Long) As Long
Private Sub ComboBox1_Change()
Const CB_SHOWDROPDOWN = &H14F
Dim Tmp
Tmp = SendMessage(ComboBox1.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0&)
'Compile error: method or data member not found
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "A"
.AddItem "B"
.AddItem "C"
.AddItem "D"
.AddItem "E"
.AddItem "F"
.AddItem "G"
End With
End Sub
Thanks in advance.
Yonnga
I have written small program with VBA in Excel, and try to use API function - "SendMessage". However, I do not know why generate error message - "Complie Error: method or data member not found" when the program is running. Could anybody help me to solve it. Below statements I wrote as:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As _
Long, lParam As Long) As Long
Private Sub ComboBox1_Change()
Const CB_SHOWDROPDOWN = &H14F
Dim Tmp
Tmp = SendMessage(ComboBox1.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0&)
'Compile error: method or data member not found
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "A"
.AddItem "B"
.AddItem "C"
.AddItem "D"
.AddItem "E"
.AddItem "F"
.AddItem "G"
End With
End Sub
Thanks in advance.
Yonnga