Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have 2 questions relative to Excel under Windows 98/2000 to submit to your attention : 1) How can I DEACTIVATE and REACTIVATE (from within a Visualbasic application) the buttons marked [X] and labeled "Close the window" (in each Excel-document-window) and "Close" (in the Excel-window itself) ? Note: the button is located at the right upper corner of the window 2) How can I access (in an Excel-document) the key [Start Prompt...] under menu path [Edition] -- [Links] -- [Start Prompt...] when the key [Links] is not activable (greyed) ? Thanks for repying me at : |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can remove the X button BUT it is bad practice to change a standard interface. If you need to know use the Workbook_BeforeClose event to trap the event when a user clicks the X.
|
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Thanks for your reply to my pos I understand your suggestion NOT TO CHANGE standard interface and I've now found a way to handle my application without disabling the X button-click However, I've try to implement your Workbook_BeforeClose event just to see how it works 1) I've first declared a class module named AppCloseEventClass and containing the following code Public WithEvents App As Applicatio I could then add the following event handling procedure to the declared class module Private Sub App_WorkbookBeforeClose (ByVal Wb As Workbook, Cancel As Boolean a = MsgBox("Do you really want to close ?", vbYesNo if a = vbNo Then Cancel = Tru End Su 2) To make that event handling procedure runnable, it was necessary to initialize (in an other module the class module as follow Dim X As New AppCloseEventClas Private Sub InitApp( Set X.App = Applicatio End Su 3) After one single run of InitApp(), I was able to trap each (but too much than desired) events WorkbookBeforeClos 4) I then added the following code at the bigin of my event handling procedure to trace the events MsgBox Wb.Nam and discovered that A LOT OF Workbooks send the event and NOT ONLY the one on which the X-button was clicked Is someone aware about that behaviour and has any suggestion to better handle the WorkbookBeforeClose event Thanks Gaston 2) ----- AA2e72E wrote: ---- You can remove the X button BUT it is bad practice to change a standard interface. If you need to know use the Workbook_BeforeClose event to trap the event when a user clicks the X. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2000 questions | Excel Discussion (Misc queries) | |||
Need help with Excel 2000 text-related functions | Excel Worksheet Functions | |||
2 questions! Related to combobox and time function. HELP!! | Excel Discussion (Misc queries) | |||
Page breaks are different in Windows 2000 and Windows XP | Excel Discussion (Misc queries) | |||
Excel Programs developed in Office 2000 on Windows 2000 | Excel Discussion (Misc queries) |