PDA

View Full Version : Application remote request



lhardee
02-26-2008, 07:35 PM
Hello to all :hi:

Great forum. I am somewhat new to vb and would like to post a question. After searching high and low, I have been unsuccessful in finding out the best way to use multiple instances of excel. I would like to use a vba form at the same time seperate excel applications are running.

application.remoterequests = false seems to be the best option. My only concern is if/when there might be a fatal error and remoterequests hasn't been set back to true.

Is there some way to trap errors and switch remoterequests back to true if fatal error should occur ?

Thank you for your time.

Bob Phillips
02-27-2008, 01:35 AM
Why do you need separate instances? I cannot see any reason for it.

lhardee
02-27-2008, 05:12 AM
Hello xld and thank you for your reply.

I put together a form used by myself and others I work with. Every so often, my coworkers aren't able to access Excel. I'm thinking that somehow a fatal error occurred because I find that Ingore Applications is checked in their options. So it seems that the form didn't have a chance to be set back to true.

Here is the code I currently use on open:




Private Sub Workbook_Open()

Parent.Application.Visible = False
Parent.Application.DisplayAlerts = False
Application.IgnoreRemoteRequests = False

Call OPENFORM

End Sub




Here is the code I use on close:



Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)

If CloseMode = vbFormControlMenu Then

Application.DisplayAlerts = False

Application.IgnoreRemoteRequests = False

Workbooks("NiseEngineering.xls").Close SaveChanges:=False
Cancel = False

End If

Application.Quit

End Sub

lhardee
02-28-2008, 05:12 AM
:help

Help please. Is there anyway to see fatal errors and switch ignore remote request back to true ?

: pray2:

Bob Phillips
02-28-2008, 05:32 AM
I personally think this is a bad idea, but if you have proper error handling you can reset it there.

lhardee
02-28-2008, 07:53 AM
Thanks xld.

Could you possibly give me an example?