ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hide TASKBAR in Sub Workbook_open() (https://www.excelbanter.com/excel-programming/296554-hide-taskbar-sub-workbook_open.html)

Dago

hide TASKBAR in Sub Workbook_open()
 
Hi,

I have an Excel application that hides all bars

With ActiveWindow
.DisplayHeadings = False
.DisplayOutline = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With

but: I want the Windows TASKbar hidden as well to get a real ful
screen view.
I want it to work in Windows 98, 2000 and XP and with Excel 97, an
2000

The code should be in the Sub Workbook_open() in the ThisWorkBoo
VBAProject in Excel

I've tried several pieces of code, which produce errors.

Is there a piece of code that I can use to hide the Windows taskba
automatically upon opening the excel file?

This code would be appreciated! If you're willing to help, pleas
provide some instructions, as I am a relative novice...

Thanks in advance!

Dag

--
Message posted from http://www.ExcelForum.com


Chip Pearson

hide TASKBAR in Sub Workbook_open()
 
Dago,

There is no programmatic way to change the visibility of the
Windows Taskbar.



"Dago " wrote in message
...
Hi,

I have an Excel application that hides all bars

With ActiveWindow
DisplayHeadings = False
DisplayOutline = False
DisplayHorizontalScrollBar = False
DisplayVerticalScrollBar = False
DisplayWorkbookTabs = False
End With

but: I want the Windows TASKbar hidden as well to get a real

full
screen view.
I want it to work in Windows 98, 2000 and XP and with Excel 97,

and
2000

The code should be in the Sub Workbook_open() in the

ThisWorkBook
VBAProject in Excel

I've tried several pieces of code, which produce errors.

Is there a piece of code that I can use to hide the Windows

taskbar
automatically upon opening the excel file?

This code would be appreciated! If you're willing to help,

please
provide some instructions, as I am a relative novice...

Thanks in advance!

Dago


---
Message posted from http://www.ExcelForum.com/




Jim Rech

hide TASKBAR in Sub Workbook_open()
 
This seems to do it:

Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function SetWindowPos Lib "user32" _
(ByVal handleW1 As Long, _
ByVal handleW1InsertWhere As Long, ByVal w As Long, _
ByVal x As Long, ByVal y As Long, ByVal z As Long, _
ByVal wFlags As Long) As Long

Public Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long

Const TOGGLE_HIDEWINDOW = &H80
Const TOGGLE_UNHIDEWINDOW = &H40
Dim handleW1 As Long

Sub HideTaskbar()
handleW1 = FindWindowA("Shell_traywnd", "")
SetWindowPos handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW
SetFocus FindWindowA("XLMAIN", Application.Caption)
End Sub

Sub UnhideTaskbar()
SetWindowPos handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW
SetFocus FindWindowA("XLMAIN", Application.Caption)
End Sub


--
Jim Rech
Excel MVP
"Dago " wrote in message
...
| Hi,
|
| I have an Excel application that hides all bars
|
| With ActiveWindow
| DisplayHeadings = False
| DisplayOutline = False
| DisplayHorizontalScrollBar = False
| DisplayVerticalScrollBar = False
| DisplayWorkbookTabs = False
| End With
|
| but: I want the Windows TASKbar hidden as well to get a real full
| screen view.
| I want it to work in Windows 98, 2000 and XP and with Excel 97, and
| 2000
|
| The code should be in the Sub Workbook_open() in the ThisWorkBook
| VBAProject in Excel
|
| I've tried several pieces of code, which produce errors.
|
| Is there a piece of code that I can use to hide the Windows taskbar
| automatically upon opening the excel file?
|
| This code would be appreciated! If you're willing to help, please
| provide some instructions, as I am a relative novice...
|
| Thanks in advance!
|
| Dago
|
|
| ---
| Message posted from http://www.ExcelForum.com/
|



Chip Pearson

hide TASKBAR in Sub Workbook_open()
 
Jim,

Yes that seems to work fine. I based my answer on an MSDN article
that says you can't programmatically change the Taskbar's
visibility. So much for MSDN...


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Jim Rech" wrote in message
...
This seems to do it:

Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function SetWindowPos Lib "user32" _
(ByVal handleW1 As Long, _
ByVal handleW1InsertWhere As Long, ByVal w As Long, _
ByVal x As Long, ByVal y As Long, ByVal z As Long, _
ByVal wFlags As Long) As Long

Public Declare Function SetFocus Lib "user32" (ByVal hwnd As

Long) As Long

Const TOGGLE_HIDEWINDOW = &H80
Const TOGGLE_UNHIDEWINDOW = &H40
Dim handleW1 As Long

Sub HideTaskbar()
handleW1 = FindWindowA("Shell_traywnd", "")
SetWindowPos handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW
SetFocus FindWindowA("XLMAIN", Application.Caption)
End Sub

Sub UnhideTaskbar()
SetWindowPos handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW
SetFocus FindWindowA("XLMAIN", Application.Caption)
End Sub


--
Jim Rech
Excel MVP
"Dago " wrote in message
...
| Hi,
|
| I have an Excel application that hides all bars
|
| With ActiveWindow
| DisplayHeadings = False
| DisplayOutline = False
| DisplayHorizontalScrollBar = False
| DisplayVerticalScrollBar = False
| DisplayWorkbookTabs = False
| End With
|
| but: I want the Windows TASKbar hidden as well to get a real

full
| screen view.
| I want it to work in Windows 98, 2000 and XP and with Excel

97, and
| 2000
|
| The code should be in the Sub Workbook_open() in the

ThisWorkBook
| VBAProject in Excel
|
| I've tried several pieces of code, which produce errors.
|
| Is there a piece of code that I can use to hide the Windows

taskbar
| automatically upon opening the excel file?
|
| This code would be appreciated! If you're willing to help,

please
| provide some instructions, as I am a relative novice...
|
| Thanks in advance!
|
| Dago
|
|
| ---
| Message posted from http://www.ExcelForum.com/
|





Michel Pierron[_2_]

hide TASKBAR in Sub Workbook_open()
 
Hi Dago;
Private Declare Function FindWindowEx& Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1&, ByVal hWnd2&, ByVal lpsz1$, ByVal lpsz2$)
Private Declare Function ShowWindow& Lib "user32" (ByVal hwnd&, ByVal nCmdShow&)

Sub TaskBar_Hide()
ShowWindow FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString), 0
End Sub

Sub TaskBar_Show()
ShowWindow FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString), 5
End Sub

MP

"Dago " a écrit dans le message de
...
Hi,

I have an Excel application that hides all bars

With ActiveWindow
DisplayHeadings = False
DisplayOutline = False
DisplayHorizontalScrollBar = False
DisplayVerticalScrollBar = False
DisplayWorkbookTabs = False
End With

but: I want the Windows TASKbar hidden as well to get a real full
screen view.
I want it to work in Windows 98, 2000 and XP and with Excel 97, and
2000

The code should be in the Sub Workbook_open() in the ThisWorkBook
VBAProject in Excel

I've tried several pieces of code, which produce errors.

Is there a piece of code that I can use to hide the Windows taskbar
automatically upon opening the excel file?

This code would be appreciated! If you're willing to help, please
provide some instructions, as I am a relative novice...

Thanks in advance!

Dago


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com