Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Hiding Parts of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Hiding Parts of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Hiding Parts of Excel

Where do I put the code so that it starts when the spreadsheet is openned?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Hiding Parts of Excel

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
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
hiding parts of a worksheet Cooz Excel Discussion (Misc queries) 5 January 8th 08 07:27 PM
Hiding number parts by cell formatting Bill G. Excel Discussion (Misc queries) 4 May 19th 07 04:50 PM
4 major parts of MS EXCEL Raj Excel Discussion (Misc queries) 3 February 3rd 07 11:45 PM
hiding parts of a cell dick Excel Discussion (Misc queries) 3 October 17th 05 02:18 AM
hiding parts of a cell dick Excel Discussion (Misc queries) 0 October 17th 05 12:49 AM


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

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

About Us

"It's about Microsoft Excel"