Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

full screen disabled when workbook minimizes 1

Status
Not open for further replies.

littlewoman

Programmer
Jan 7, 2005
34
0
0
NL
Greetings,

Using:
excel 2003 - vba
with a little bit of knowledge

Creation:
I have created an "standalone" version of several interactive workbooks.
With standalone I mean that, in workbook_open, all sheetfunctions (scrollbars, tabs, etc.) and commandbars are disabled, my commandbar is docked at top and, to lose the systemmenu on top, the workbook is set to full screen.
The systemmenu was needed to disappear to force users to use my closebutton on the commandbar so the workbook is saved and excel is restored to standard appearance.
The sheetfunctions are needed to be turned off to hide the database on the sheets (behind the first 'title'sheet) for unauthorized use.
From this point on all is regulated by forms which are activated from my_commandbar.
All works like a dream no problems here.

Problem:
Now I found that if the workbook is minimized (by clicking on the taskbar or by the quickstartmenu) and restored back (by clicking on it in the taskbar) the full screen function is disabled. This means that the systemmenu and the formula bar reappear and that my commandbar is invisible.

Solutions tried:
I have tried to use a class event module to get fullscreen back (workbook_windowminimize as described in the helpfiles) but that doesn't work on workbook minimization.

Then I've tried to abandon FullScreen and docked my_commandbar on top below the systemmenu. Now on restore the formulabar is gone and my commandbar reappears but the systemmenu closebutton is in reach also. So I tried to redirect the closure as done with code as is used with closemode in Userform_Queryclose by placing the code in Workbook_QueryClose or Workbook_Close but that didn't work also.

Question:
Is there some way to reactivate full screen and my commandbar when workbook is restored from minimization?
Or an way to redirect the system closebutton as can be done with userform closebutton? (which in turn could also be handy for restoring excel on outside closure as by windows or taskmanager)

Thnx in advance.


 
Have you been reading the MS Excel VBA Bible ?> as the above sounds very much like one of the examples in the book.

Chance,

Filmmaker, taken gentleman and [insert quote here]
 
Is thát what it's called?
lol

But no, just trying to accomplish something with a high knowledge of excel and low knowledge of vba and learning along the way. (although a bit more of success and less of learning would be appreciated at this point. :-s )

Yet...
if I'm reading a bible, according to you, what are you reading then? I see no answer in your post. :p



 
Ok there is a API call which you can turn off the toolbar in excel, though this is complicated,

also is your

Private Sub Workbook_BeforeClose(Cancel As Boolean)

End Sub

in Thisworkbook ?


Any code here in Thisworkbook, will run before the user closes the excel book, regardless of way they are exiting.

also have you thought about using

Private Sub Worksheet_Activate()

End Sub



Chance,

Filmmaker, taken gentleman and [insert quote here]
 
Ok, Workbook_BeforeClose indeed redirects the systemclosebutton and 'outside' closure.
That's usefull indeed :)

Worksheet_Activate does nothing usefull. I think 'cause the worksheet is not manipulated on minimization en restoring of the workbook.

But in any case I can tackle this problem with Workbook_BeforeClose. Something indeed I hadn't looked into yet. Shame on me.

Indeed API-calls is still far beyond me, won't tackle that for a time to come. First the basics, and that's hard enough at this point :)

Thnx a million, Change, I now know for sure I can't understand yet what you're reading :p :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top