+ Reply to Thread
Results 1 to 4 of 4

Really Really Stumped!

  1. #1
    Duncan
    Guest

    Really Really Stumped!

    Hi all,

    Ive finally got my form to display properly by using .show vbmodless
    and application.visible = false and im also using part of formfun (the
    cbmodal values which im not really sure what they do but that not
    important)

    So my form opens up on the desktop looking all standalone and on its
    own, if a user opens excel the app (like off the start bar) then they
    can use the big red x to close that instance and my form remains, yet
    if they just double click on a workbook to open it will open up in my
    instance?! so when they close it by the big red x it also closes my
    form!

    Im not sure if there is anything I can do about this, but really I want
    the users to open another workbook if they want, and for it to be
    completely seperate to my form one so that they can close or whatver
    they want and it will not affect my modeless form.

    Is this possible? any ideas anyone?

    Duncan


  2. #2
    Tom Ogilvy
    Guest

    RE: Really Really Stumped!

    Before you show your userform and hide the application do you do

    Application.IgnoreRemoteRequests = True

    --
    Regards,
    Tom Ogilvy


    "Duncan" wrote:

    > Hi all,
    >
    > Ive finally got my form to display properly by using .show vbmodless
    > and application.visible = false and im also using part of formfun (the
    > cbmodal values which im not really sure what they do but that not
    > important)
    >
    > So my form opens up on the desktop looking all standalone and on its
    > own, if a user opens excel the app (like off the start bar) then they
    > can use the big red x to close that instance and my form remains, yet
    > if they just double click on a workbook to open it will open up in my
    > instance?! so when they close it by the big red x it also closes my
    > form!
    >
    > Im not sure if there is anything I can do about this, but really I want
    > the users to open another workbook if they want, and for it to be
    > completely seperate to my form one so that they can close or whatver
    > they want and it will not affect my modeless form.
    >
    > Is this possible? any ideas anyone?
    >
    > Duncan
    >
    >


  3. #3
    Duncan
    Guest

    Re: Really Really Stumped!

    Yep, tried this but still same problems.....I really dont have a clue
    what to do!

    Duncan


  4. #4
    Nigel
    Guest

    Re: Really Really Stumped!

    I use the following method that you maybe able to adapt, on opening your
    primary application it determines if there are other Excel workbooks open,
    and asks the user to close them first. If not then it closes all other
    Excel files, this will be other auto open workbooks e.g. Personal.xls. When
    this application (Dashboard.xls in my case) is running opening another
    workbook will deactivate my application and trigger the test again. HTH

    Option Explicit
    Public wbOpen As Boolean
    Private Sub Workbook_Deactivate()
    If Workbooks.Count > 1 And wbOpen Then


    Application.ScreenUpdating = True

    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True

    MsgBox "You must close the Dashboard before opening another workbook" &
    vbCrLf & _
    "If you wish to copy tables from the Dashboard, open another instance
    of Excel", vbExclamation + vbOKOnly, "Dashboard Messaging"
    'close the rogue book

    End If

    End Sub


    Private Sub Workbook_Open()

    Application.ScreenUpdating = False

    ' if user has a personal.wks in xlstart directory - close it!
    Dim wb As Workbook
    For Each wb In Application.Workbooks
    If UCase(wb.Name) <> "DASHBOARD.XLS" Then
    Application.DisplayAlerts = False
    wb.Close
    Application.DisplayAlerts = True
    End If
    Next

    ' control if another workbook is opened by a double click in explorer
    wbOpen = True
    If Workbooks.Count > 1 Then
    MsgBox "You must close the current Excel workbooks before opening
    the Dashboard" & vbCrLf & _
    "If you wish to copy tables from the Dashboard, close Excel and
    open the Dashboard first" & vbCrLf & _
    "then open another instance of Excel", vbExclamation + vbOKOnly,
    "Dashboard Messaging"
    wbOpen = False
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
    Application.DisplayAlerts = True
    End If

    End Sub










    --
    Cheers
    Nigel



    "Duncan" <[email protected]> wrote in message
    news:[email protected]...
    > Yep, tried this but still same problems.....I really dont have a clue
    > what to do!
    >
    > Duncan
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1