- ·上一篇:excel表格横杠图怎么做
- ·下一篇:excel表格表中公式怎么显示
excel表格怎么调整工作簿
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