Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Private Sub Workbook_Open() doesn't run | Excel Discussion (Misc queries) | |||
About workbook_Open madro | Excel Worksheet Functions | |||
Workbook_Open () | Excel Discussion (Misc queries) | |||
Help with Workbook_Open | Excel Programming | |||
Workbook_Open() error | Excel Programming |