#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default macro help

Excel 2007 -The following works just fine :-

Sub DisplayRibbon()

Application.DisplayFullScreen = False

End Sub

However when I do this :-

Private Sub Workbook_BeforeClose(Cancel As Boolean)

DisplayRibbon

******Other code here******

End Sub

the formula bar displays and but not the Menus or Ribbon.

Any ideas?
Sandy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default macro help

Hi Sandy

You can use a Excel4 macro

See

Sub HideRibbon()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
End Sub


Sub ShowRibbon()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
End Sub

See also this page for more info
http://www.rondebruin.nl/ribbon.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Sandy" wrote in message ...
Excel 2007 -The following works just fine :-

Sub DisplayRibbon()

Application.DisplayFullScreen = False

End Sub

However when I do this :-

Private Sub Workbook_BeforeClose(Cancel As Boolean)

DisplayRibbon

******Other code here******

End Sub

the formula bar displays and but not the Menus or Ribbon.

Any ideas?
Sandy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default macro help

I have tried that Ron - the point is that I cannot get the ribbon (or more
importantly) the Close File or Close Application buttons to be visible. When
the "Do you want to save the changes......etc" dialog box appears Clicking
Yes or No is fine but if Cancel is selected there are no Close Buttons on
view.

The code you suggest works fine on its own but not when associated with the
Worksheet_BeforeClose event (at least not in my application).
Sandy

"Ron de Bruin" wrote in message
...
Hi Sandy

You can use a Excel4 macro

See

Sub HideRibbon()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
End Sub


Sub ShowRibbon()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
End Sub

See also this page for more info
http://www.rondebruin.nl/ribbon.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Sandy" wrote in message
...
Excel 2007 -The following works just fine :-

Sub DisplayRibbon()
Application.DisplayFullScreen = False
End Sub

However when I do this :-

Private Sub Workbook_BeforeClose(Cancel As Boolean)
DisplayRibbon

******Other code here******

End Sub

the formula bar displays and but not the Menus or Ribbon.

Any ideas?
Sandy

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default macro help

Try this instead of the open and beforeclose events Sandy

Private Sub Workbook_Activate()
HideRibbon
End Sub

Private Sub Workbook_Deactivate()
ShowRibbon
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Sandy" wrote in message ...
I have tried that Ron - the point is that I cannot get the ribbon (or more
importantly) the Close File or Close Application buttons to be visible. When
the "Do you want to save the changes......etc" dialog box appears Clicking
Yes or No is fine but if Cancel is selected there are no Close Buttons on
view.

The code you suggest works fine on its own but not when associated with the
Worksheet_BeforeClose event (at least not in my application).
Sandy

"Ron de Bruin" wrote in message
...
Hi Sandy

You can use a Excel4 macro

See

Sub HideRibbon()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
End Sub


Sub ShowRibbon()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
End Sub

See also this page for more info
http://www.rondebruin.nl/ribbon.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Sandy" wrote in message
...
Excel 2007 -The following works just fine :-

Sub DisplayRibbon()
Application.DisplayFullScreen = False
End Sub

However when I do this :-

Private Sub Workbook_BeforeClose(Cancel As Boolean)
DisplayRibbon

******Other code here******

End Sub

the formula bar displays and but not the Menus or Ribbon.

Any ideas?
Sandy

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
Macro to copy and paste values (columns)I have a macro file built C02C04 Excel Programming 2 May 2nd 08 01:51 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 02:11 AM.

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"