Hiding the CommandBars

C

Craig

Hi there,
I'm trying to hide the look of excel in my program without creating
userforms for everything.
I'm usung this code at startup:

Application.CommandBars.ActiveMenuBar.Enabled = False
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Enabled = False

This works but as I change sheets via command buttons... I get a blank gray
bar at the top of the screen.
It also does this when I bring up a Userform I created.

The only way I can get rid of this blank gray bar is by right clicking and
selecting one of the toolbars then right clicking again to remove it.

Is there a way I don't have to see this blank gray bar??

Thanks Craig
 
C

Craig

I placed your code in ThisWorkBook.Activate and Deactivate
Works great from switching between worksheets.... but when I activate a
userform the gray blank bar comes back.
When I close the userform the blank gray bar is still there.

Craig
 
C

Craig

Yes... the userform is the same file, I'll try creating another userform to
see if it does it too.
Craig
 
C

Craig

Ron... I've traced to what part of my code is causing this error. It happens
when the code Activates another sheet.
This sheet change is for a combobox, heres the code:
The "Console" Worksheet is the Active sheet at start of code execution.

Private Sub CommandButton8_Click()
Dim varLastRow
Application.ScreenUpdating = False

'More code here to set vaules on the userform

frmAudit.cboStore_Select.clear

Store_Info.Activate ' This is where the error is made.

Store_Info.Range("B2").End(xlDown).Select
varLastRow = Activecell.Row
frmAudit.cboStore_Select.AddItem ("<Select Store>")
Store_Info.Range("B2").Select
For x = 3 To varLastRow + 1
frmAudit.cboStore_Select.AddItem (ActiveCell.Value)
Activecell.Offset(1, 0).Select
Next x
frmAudit.cboStore_Select.ListIndex = 0
Console.Activate
Application.ScreenUpdating = True
frmAudit.Show
End Sub

Here is the code in my ThisWorkBook:

Private Sub Workbook_Activate()
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False
Application.ShowStartupDialog = False
Application.ShowWindowsInTaskbar = False
Application.CommandBars("Cell").Enabled = False
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.DisplayVerticalScrollBar = False
ActiveWindow.DisplayWorkbookTabs = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.CommandBars("Full Screen").Enabled = True
End Sub

The Workbook_Deactivate() is the same with opposite values

This is hand type... so their may be some typo's

Craig
 
B

Bruce001

Craig,

I was wondering if you found a way to get rid of the gray bar at th
top of your screen. I am also getting this same error when I ope
another work book, make a sheet active in that workbook, and then mov
a bunch of data to my workbook. When the other workbook closes, th
line is there.

ANy help or experience you can share would be appreciated
 

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

Top