Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like my spreadsheet to hide parts of excel when a user opens it. Ideally it would hide almost everything, scrollbar, status bar, formula bar, sheet tabs etc. Can this be done with code and what code would it be?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've seen solutions which do it, with problems.
This example I've seen sometimes wasn't able to restore the settings, so when the user loaded Excel they got a menu bar and nothing else. Helpdesk calls galore. It's probably possible to do it properly though. I recommend that you resist fighting Excel and try to work with it. Most users are comfortable with the interface and standard toolbars. One way using FullScreen: Sub test() With Application .DisplayFullScreen = True .CommandBars("Full Screen").Visible = False End With With ActiveWindow .DisplayHeadings = False .DisplayHorizontalScrollBar = False .DisplayVerticalScrollBar = False .DisplayWorkbookTabs = False End With End Sub Here's another way (test destroys, test2 restores) Sub test() Dim cmd As CommandBar With Application .DisplayFormulaBar = False .DisplayStatusBar = False .DisplayScrollBars = False For Each cmd In .CommandBars If cmd.Visible And Not cmd.Name = ..CommandBars.ActiveMenuBar.Name Then cmd.Controls(1).Tag = "Restore Me" cmd.Visible = False End If Next End With 'stuff that you gets saved with the workbook With ActiveWindow .DisplayHeadings = False .DisplayHorizontalScrollBar = False .DisplayVerticalScrollBar = False .DisplayWorkbookTabs = False End With End Sub Sub test2() On Error Resume Next Dim cmd As CommandBar With Application .DisplayFormulaBar = True .DisplayStatusBar = True .DisplayScrollBars = True For Each cmd In .CommandBars If cmd.Controls(1).Tag = "Restore Me" Then cmd.Controls(1).Tag = "" cmd.Visible = True End If Next End With End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Neil" wrote in message ... I would like my spreadsheet to hide parts of excel when a user opens it. Ideally it would hide almost everything, scrollbar, status bar, formula bar, sheet tabs etc. Can this be done with code and what code would it be? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where do I put the code so that it starts when the spreadsheet is openned?
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I suspect that you want to make Excel look like just any other application.
I strongly recommend that you do not hide parts of Excel for this purpose. Don't fight Excel's interface. Work *with* it - the features are useful to users. Here's your answer: Private Sub Workbook_Open() 'code here to hide Excel bits End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) 'code here to unhide Excel bits End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Neil" wrote in message ... Where do I put the code so that it starts when the spreadsheet is openned? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hiding parts of a worksheet | Excel Discussion (Misc queries) | |||
Hiding number parts by cell formatting | Excel Discussion (Misc queries) | |||
4 major parts of MS EXCEL | Excel Discussion (Misc queries) | |||
hiding parts of a cell | Excel Discussion (Misc queries) | |||
hiding parts of a cell | Excel Discussion (Misc queries) |