Results 1 to 4 of 4

Thread: Forms in Excel

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Posts
    406

    Forms in Excel

    I have an 'automated' Excel report and I wanted to use a form to hold a text box that would display the status of the report as it is running.

    I have never used forms in Excel before, and to my dismay, they do not have all the properties accociated with normal VB forms.

    Here is what I would like to do with the form:

    I don't want the user to be able to close the form
    I want the user to be able to minimize the form
    I want the form to remain on TOP of all other windows

    Is it possible to do the above?

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    Nope.

    You can stop closing with the Terminate event. You can fake a minimize that reduces the UserForm size and puts it out of the way. But the UserForm acts as part of the Excel application. After all, it is VB FOR applications. If you minimize the app the UserForm minimizes along with it. The UserForm doesn't have an hWnd so you can't use API to make it always on top.

    You either have to start something else to show the status, find some APIs that will show a status window, or just go with showing the status in the Excel status bar.


  3. #3
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127
    UserForms can be made to stay on top. My current project has a UserForm that stays on top of the WorkBook. I don't see any property for this, and have done nothing to make it do this. I can't tell you how to make it work for you, but it proves it can be done.

    Edit: In response to the reply after this: "Oops, misunderstood what he was intending it to be "Always on Top" of."
    Last edited by Daniel McCool; Feb 21st, 2004 at 12:11 AM.
    "Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond

  4. #4
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    How the UserForm operates compared to the Workbook is determined by the ShowModal property. UserForms can stay on top of the Workbook, but they can not stay on top of other applications if the Workbook is minimized. If the Excel Application is not on top, then the "Visual Basic" UserFrom for the "Application" (VBA) cannot "remain on TOP of all other windows".

Posting Permissions

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



Click Here to Expand Forum to Full Width