- Kod: Tümünü seç
'Insert an image control into worksheet
'Set ico file from the picture property of the image control
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Const WM_SETICON = &H80
Private Const ICON_SMALL = 0&
Private Const ICON_BIG = 1&
Sub ChangingTest()
MsgBox "Chane Excel Icon"
Call ChangeXLIcon(ActiveSheet.Image1.Picture.Handle)
'It's for testing
MsgBox "Back Excel Icon as default"
Call ChangeXLIcon
End Sub
Private Sub ChangeXLIcon(Optional ByVal hIcon As Long = 0&)
Dim hWnd As Long
Dim lngRet As Long
hWnd = FindWindow("XLMAIN", Application.Caption)
lngRet = SendMessage(hWnd, WM_SETICON, ICON_SMALL, ByVal hIcon)
lngRet = SendMessage(hWnd, WM_SETICON, ICON_BIG, ByVal hIcon)
lngRet = DrawMenuBar(hWnd)
End Sub



![Teşekkür ediyorum [TESEKKÜR]](./images/smilies/tesekkur.gif)