当前位置:首页经验技巧Excel经验excel技巧

excel表格怎么调整工作簿

2024-10-23 09:10:04

1.怎样修改EXCEL工作薄图标

自定义Excel工作薄图标和标题

首先,在要打开的Excel工作薄所在的文件夹下建立一个ICO图标文件,再在对象ThisWorkbook中编辑以下的代码:' 对象ThisWorkbook的代码,目的是改变Excel标题栏的图标和标题 ' 借鉴于chijanzen大师(微软MVP)的原创代码Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function SetFocus Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long Private Const WM_SETICON = &H80Function hWndForm() As Long hWndForm = FindWindow(vbNullString, Application.Caption) End FunctionPrivate Sub Workbook_Open() Dim IStyle As Long, hIcon As Long hIcon = ExtractIcon(0, ActiveWorkbook.path & "\Ico.ico", 0) '选择一个ICO图标,将"Ico.ico"替换掉 SendMessage hWndForm, WM_SETICON, True, hIcon SendMessage hWndForm, WM_SETICON, False, hIcon DrawMenuBar hWndForm SetFocus hWndForm Application.Caption = "GaoYuexun的表格:" '自定义标题栏,文字可替换 End Sub


电脑版

免责声明:本站信息来自网络收集及网友投稿,仅供参考,如果有错误请反馈给我们更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任,谢谢您的合作。
版权所有:五学知识网 Copyright © 2015-2024 All Rights Reserved .