Trying to pass an image as a variable to API. Have tried "OleObjects", "Shapes" and "Controls".
VBA Code:
Sub AddFormIcon(TitlebarCaption, WBName, SHName, img) ' Pass "img" from here to
Dim hwnd As Long
Dim lngRet As Long
Dim hIcon As Long
hIcon = Workbooks(WBName).Worksheets(SHName).img.Picture.Handle ' here
hwnd = FindWindow(vbNullString, TitlebarCaption) ' Form caption, not name; for form use frmName.Caption.
lngRet = SendMessage(hwnd, WM_SETICON, ICON_SMALL, ByVal hIcon)
lngRet = SendMessage(hwnd, WM_SETICON, ICON_BIG, ByVal hIcon)
lngRet = DrawMenuBar(hwnd)
End Sub