Hiding the Ribbon in A2007 (1 Viewer)

CanWest

Registered User.
Local time
Today, 01:58
Joined
Sep 15, 2006
Messages
272
I have done a lot of reading on this and have seen that
Code:
DoCmd.ShowToolbar “Ribbon”, acToolbarNo
Should hide the ribbon. Instead I get a 'Variable Not Found' error.

This should be simple. Am I missing something here?
 

ypma

Registered User.
Local time
Today, 08:58
Joined
Apr 13, 2012
Messages
643
This is very similar to a post yesterday and what works for me is the following :

If you right click the FILE button on the top of the ribbon , click the MinimizeRibbon which will

do what it says until you click again ./
The onload i use the following which i found on this forum .
Code:
If Not CommandBars.GetPressedMso("MinimizeRibbon") Then
CommandBars.ExecuteMso "MinimizeRibbon"
End If
Code:
 

CanWest

Registered User.
Local time
Today, 01:58
Joined
Sep 15, 2006
Messages
272
This is very similar to a post yesterday and what works for me is the following :

If you right click the FILE button on the top of the ribbon , click the MinimizeRibbon which will

do what it says until you click again ./
The onload i use the following which i found on this forum .
Code:
If Not CommandBars.GetPressedMso("MinimizeRibbon") Then
CommandBars.ExecuteMso "MinimizeRibbon"
End If
Code:

Actually this won't work for my application. I need the ribbon completely hidden. If it is minimized the user can simply maximize it and I do not want them to be able to do that.

But thank you for your Idea. I am sure I will use that in another project down the road.
 

mdlueck

Sr. Application Developer
Local time
Today, 03:58
Joined
Jun 23, 2011
Messages
2,631
Actually this won't work for my application. I need the ribbon completely hidden. If it is minimized the user can simply maximize it and I do not want them to be able to do that..

I found the Internet full of suggestions to completely hide the A2007 Ribbon. I was seeking to Minimize it, and FINALLY received the correct suggestion here:

Minimize Ribbon
http://www.access-programmers.co.uk/forums/showthread.php?t=231335

Oh... re-reading that post, maybe it was Navigation Pane it was possible to completely disable.

I will try to remember if there was a suggestion how to completely disable the Ribbon.
 

mdlueck

Sr. Application Developer
Local time
Today, 03:58
Joined
Jun 23, 2011
Messages
2,631
I have done a lot of reading on this and have seen that
Code:
DoCmd.ShowToolbar “Ribbon”, acToolbarNo
Should hide the ribbon. Instead I get a 'Variable Not Found' error.

This should be simple. Am I missing something here?

First I noticed you had fancy double quote characters surrounding Ribbon, rather than the simple Chr(34) one.

Code:
? Asc("“")
 147 
? Asc("”")
 148

Issuing this in the Immediate window hides the ribbon for me:

Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
And this brings it back:

Code:
DoCmd.ShowToolbar "Ribbon", acToolbarYes
 

CanWest

Registered User.
Local time
Today, 01:58
Joined
Sep 15, 2006
Messages
272
I found the Internet full of suggestions to completely hide the A2007 Ribbon.

As did I. And the code above is supposed to work. But I keep getting a variable not found error. I believe it is having trouble with the word Ribbon in quotes but I am not sure what other name the ribbon would go by.
 

Ari

Registered User.
Local time
Today, 00:58
Joined
Oct 22, 2011
Messages
139
Hi

Activate in VBA, the reference "Microsoft Office 12.0 object library"
 

mdlueck

Sr. Application Developer
Local time
Today, 03:58
Joined
Jun 23, 2011
Messages
2,631
And the code above is supposed to work. But I keep getting a variable not found error. I believe it is having trouble with the word Ribbon in quotes but I am not sure what other name the ribbon would go by.

Did you see my reply in #5? That is exactly what I was suspecting.
 

ypma

Registered User.
Local time
Today, 08:58
Joined
Apr 13, 2012
Messages
643
Michael , Using your code in #5 works fine, i am using access 2010 could that be a factor ?
For my demo I have used Command buttons but the code work also on Current event.
 

Attachments

  • RibbonOffOn.accdb
    352 KB · Views: 91

mdlueck

Sr. Application Developer
Local time
Today, 03:58
Joined
Jun 23, 2011
Messages
2,631
Using your code in #5 works fine, i am using access 2010 could that be a factor ?

???? What is the issue since you say it is working fine?

I verified my sample code in #5 works flawlessly in the A2010 Immediate Window, same as on A2007.
 

ypma

Registered User.
Local time
Today, 08:58
Joined
Apr 13, 2012
Messages
643
???? What is the issue since you say it is working fine?
The point i was trying unsuccessfully to make was that CanWest the originator of the Op is using ac2007, but you ruled that out as a factor as to why he cannot get it to work . I am assuming his problem is still not resolved
 

mdlueck

Sr. Application Developer
Local time
Today, 03:58
Joined
Jun 23, 2011
Messages
2,631
ypma, I had not caught you were not the OP! :rolleyes:

I am suspecting a quote issue, will only find out if the OP returns.
 

Users who are viewing this thread

Top Bottom