Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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/
|


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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/
|




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Private Sub Workbook_Open() doesn't run Steve Starr Excel Discussion (Misc queries) 4 April 3rd 11 05:05 AM
About workbook_Open madro Miguel Angel Excel Worksheet Functions 0 November 2nd 06 12:00 PM
Workbook_Open () Bill Martin Excel Discussion (Misc queries) 12 December 20th 05 05:37 PM
Help with Workbook_Open Ruan[_3_] Excel Programming 7 April 28th 04 07:52 AM
Workbook_Open() error Ruan[_3_] Excel Programming 2 September 13th 03 09:13 PM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"