Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default display statusbar, scrollbars and formulabar

I have a workbook where I want to hide all menu bars and toolbars for
the user when it’s opened. On the other hand, when the workbook is
closed (with a ‘close’ button on the sheet) I’d like to turn everything
back on.
The code is doing fine on the workbook_open event. Everything is
hidden, as I want. However, on the closebutton_click event everything
works fine except for the following 3 lines:

Application.displaystatusbar = true
Application.displayscrollbars = true
Application.displayformulabar = true

For all 3 I get the similar message:

Run-time error 1004 method ‘displayscrollbars’ of object ‘_application’
failed

However, when I write those lines in a separate sub and run it
manually, they work fine. If I try to call this sub when closing the
workbook the error appears again.

Does anyone know what’s happening?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default display statusbar, scrollbars and formulabar

Sounds like you are running the commands without a workbook being open. Run
them, then close the workbook.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"marecq" wrote in message
...
I have a workbook where I want to hide all menu bars and toolbars for
the user when it's opened. On the other hand, when the workbook is
closed (with a 'close' button on the sheet) I'd like to turn everything
back on.
The code is doing fine on the workbook_open event. Everything is
hidden, as I want. However, on the closebutton_click event everything
works fine except for the following 3 lines:

Application.displaystatusbar = true
Application.displayscrollbars = true
Application.displayformulabar = true

For all 3 I get the similar message:

Run-time error 1004 method 'displayscrollbars' of object '_application'
failed

However, when I write those lines in a separate sub and run it
manually, they work fine. If I try to call this sub when closing the
workbook the error appears again.

Does anyone know what's happening?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default display statusbar, scrollbars and formulabar

Workbook is open, but yesterday evening I found a possible solution to
avoid the problem. I noticed that the code doesn’t work as long as one
of the buttons on the worksheet has the focus (?). So a simple solution
is to start the code with something like:
Cells(1,1).select

Now it’s working fine (though I still don’t know why it didn’t work the
other way)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
FIX in Statusbar Stefi Excel Discussion (Misc queries) 2 July 30th 08 01:34 PM
Hide Formula in Formulabar ROHIT Excel Discussion (Misc queries) 6 August 2nd 05 01:51 PM
Reveal cell formats and extendable range in tool/statusbar/icon. Danny O'Hern ([email protected]) Excel Worksheet Functions 0 April 29th 05 01:16 PM
Getting rid of scrollbars for listbox Marcie Excel Programming 2 September 20th 03 11:15 PM
StatusBar Msg? Tom Ogilvy Excel Programming 4 September 10th 03 02:32 PM


All times are GMT +1. The time now is 12:38 AM.

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

About Us

"It's about Microsoft Excel"