microsoft_excel:macro_show_excel_on_top
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
microsoft_excel:macro_show_excel_on_top [2016/07/11 11:31] – created peter | microsoft_excel:macro_show_excel_on_top [2021/08/04 14:25] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Microsoft Excel - Macro Show Excel on Top ====== | ||
- | <code excel> | ||
- | Sub ShowXLOnTop(ByVal OnTop As Boolean) | ||
- | |||
- | Dim xStype As Long | ||
- | |||
- | #If Win64 Then | ||
- | Dim xHwnd As LongPtr | ||
- | #Else | ||
- | Dim xHwnd As Long | ||
- | #End If | ||
- | |||
- | If OnTop Then | ||
- | xStype = HWND_TOPMOST | ||
- | Else | ||
- | xStype = HWND_NOTOPMOST | ||
- | End If | ||
- | | ||
- | Call SetWindowPos(Application.hwnd, | ||
- | | ||
- | End Sub | ||
- | |||
- | |||
- | ' Sets that XL is the top window of all applications. | ||
- | Sub SetXLOnTop() | ||
- | ShowXLOnTop True | ||
- | End Sub | ||
- | |||
- | |||
- | ' Sets that XL is not necessarily the top windows of all applications. | ||
- | ' If this were not run at some stage then no other application, | ||
- | Sub SetXLNormal() | ||
- | ShowXLOnTop False | ||
- | End Sub | ||
- | </ |
microsoft_excel/macro_show_excel_on_top.1468236700.txt.gz · Last modified: 2020/07/15 09:30 (external edit)