Hide Scrollbars

  • Thread starter Thread starter blackbox via OfficeKB.com
  • Start date Start date
B

blackbox via OfficeKB.com

I'm trying to hide the horizontal and vertical scrollbars on a worksheet with

DisplayHorizontalScrollBar = False
DisplayVerticalScrollBar = False

but it's not working.

Any ideas?
 
hi
with activewindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
end with

regards
FSt1
 
here's all the code, everything worksexcept the scrollbars

Sub RemoveToolbars()
On Error Resume Next
With ActiveWindow
.DisplayFullScreen = False
.CommandBars("Full Screen").Visible = False
.CommandBars("MyToolbar").Enabled = False
.CommandBars("MyToolbar").Visible = False
.CommandBars("Worksheet Menu Bar").Enabled = False
.CommandBars("Formatting").Visible = False
.CommandBars("Standard").Visible = False
.CommandBars("Reviewing").Visible = False
ActiveWindow.DisplayHeadings = False
.DisplayFormulaBar = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
End With
On Error GoTo 0
End Sub
 
hi.
I copied your code and it worked on my pc. using xp xl2003.
I changed all of the falses to trues and it put everything back.
so i am now officially stumped.

Sorry
FSt1
 
Well, the plot thickens...

I just tried the same code at home (Office XP)

and it hides the row/column headers and the scrollbars but nothing else.

I checked to make sure the menu bars and command bars all have the same names,
which they do, as what ever version of Office they use at work. ('97 I think)

So... I'm not quite sure where to go from here.

I have a copy of Office 2007 but have been hesitant to install it due to all
complaints about running slow or crashing when macros are run.
 
Remove the On Error Resume Next to see the real cause of the error.
Hint: Is a CommandBar a member of the ActiveWindow ?

NickHK
 
thanks for all your help.

I moved the scrollbar instructions to the top of the list and everything
works
Remove the On Error Resume Next to see the real cause of the error.
Hint: Is a CommandBar a member of the ActiveWindow ?

NickHK
Well, the plot thickens...
[quoted text clipped - 9 lines]
I have a copy of Office 2007 but have been hesitant to install it due to all
complaints about running slow or crashing when macros are run.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top