Results 1 to 3 of 3
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Excel 95 Dialog Sheets

    I have to develop some solutions belive it or not in Excel 95. I have encountered the following problems and wonder if there are any solutions.

    1. I am trying to close the active book from the cancel button of a dialogue box, but get error 1004 when I use the command Activeworkbook.Close Savechanges:=False
    Any Solutions ?

    2. I do NOT want my dialog boxes to have a close button top right. Can I remove this ? Do I need to use an API call and if so what ?

    3. Is it possible to Cancel the close event of a workbook in Excel 95 and if so how.

    NO... I cannot convert to Office 97 or above !

    Any help greatfully accepted - Andrew Walker

    andrew@d-l-r.co.uk
    Andrew

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel 95 Dialog Sheets

    Andrew,

    I don't know if I'll be of much help, but anyway, here are some comments:

    1. To solve this, maybe you should try to record a macro when you are closing the activeworkbook (not from a dialog box, but from Excel), then, maybe you'll get some useful code that directs you to a solution. Error 1004 is typically an error that you get if the method of an object failed. Maybe the method close of the ActiveWorkbook didn't exist in Excel 95 or the savechanges property???
    2. In Excel 97 or 2000, there exists a UserForm_QueryClose event. When you click the X in the upper-right corner of the userform, this event is executed before the userform closes. If you click the X button, then the CloseMode argument is equal to vbFormControlMenu (a built-in constant). If, in this case, you set the Cancel argument to True, the form is not actually closed. I am sorry if this dialog event does not exist in Excel 95. I can't test it out.
    3. I am quite sure that workbook and worksheet events did not exist in Excel 95. You can play with the Auto_Close event to execute some code before closing.

    Hope this helps you to solve your middle-age problems (sorry, I am only joking)

  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Excel 95 Dialog Sheets

    Thanks for the info....
    I wish they would use Excel 97 then all my headaches would go. Excel 95 does support the Activeworkbook.close methods but it appears NOT from a custom dialogsheet and these have NO apparent events associated with them unlike the 97 userforms.

    I have tried calling the auto_close routine from the dialog as well but sadly no joy there either.
    I even tried a doevents assuming that it might be clashing with closing the dialog, but it appears that it cannot close the book while the dialog box is open.
    My only other choice is to use possibly to force the window closed using a window API call. Dirty but it might work.

    Andrew
    Andrew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •