Really Really Stumped!

D

Duncan

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
 
T

Tom Ogilvy

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

Application.IgnoreRemoteRequests = True
 
D

Duncan

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

Duncan
 
N

Nigel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top