Ignore DDE, IgnoreRemoteRequests - 16.0 changes

Scotster

New Member
Joined
May 29, 2017
Messages
25
Hi there,

I'm wondering if anyone else uses the ignore DDE option the same way as I did, and have found a workaround to the issue I am facing, or if anyone can simply help with a solution/workaround.

Previously when I checked the Ignore DDE option or used Application.IgnoreRemoteRequests = True, any time I opened an excel file it would open in a separate instance of Excel. Now, it opens up in the current instance.

This is an issue for me as I have a small program/userform that I use and have always kept separate. I do this by hiding the application on open, displaying the Userform and ignoringremoterequests. This means that any time I open any other Excel file it opens up in a separate instance and leaves my program happily running at the side.

Since the 16.0 upgrade (Office 365) this no longer functions this way. Ignoring DDE seems to have absolutely zero impact and now when I open a file it opens in the same instance of Excel, unhiding my hidden instance and leaving me with no option but to kill my open userform.

Is there any way to actually separate the instance with v16 so that it opens any subsequent files in a new instance?

FWIW we only have office 365 on our Win10 machines, our Win7 Machines are still on 14.0 and all work flawlessly with the code I have. I noticed quite a few changes since the update in the way that previous functionality seems to have disappeared.

Any help would be greatly appreciated :)
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,560
Office Version
2016
Platform
Windows
Was it you who asked a similar question here before ? :)

One workaround that might slightly work is by hooking the excel events at the application level. The code would reside inside an addin so that when your small program opens, the addin would detect it and check if there are any other workbooks already open in the current excel session and if so, close the program and reopen it in a seperate instance.

If on the other hand the small program is open and then the user tries opening another workbook, the addin would do a similar check to ensure the small program is left running in its own seperate instance. (This step may require more code)

Sure this is not an elegant fix but might work in your specific situation.
 

Scotster

New Member
Joined
May 29, 2017
Messages
25
Was it you who asked a similar question here before ? :)

One workaround that might slightly work is by hooking the excel events at the application level. The code would reside inside an addin so that when your small program opens, the addin would detect it and check if there are any other workbooks already open in the current excel session and if so, close the program and reopen it in a seperate instance.

If on the other hand the small program is open and then the user tries opening another workbook, the addin would do a similar check to ensure the small program is left running in its own seperate instance. (This step may require more code)

Sure this is not an elegant fix but might work in your specific situation.
I've asked a similar question in the past but we just had a very recent office update and it's completely killed the feature altogether. I'm trying to figure out if it's a bug/loss of functionality with the software that hasn't been noticed..... or if the effects of ignoring DDE were simply coincidental before.

I can play with the Open event but I have loads of stuff that uses this in work. We are currently migrating to Win10 which is when all hell is going to break loose with my automated code :biggrin:

If it is indeed something wrong with the software then I would contact Microsoft to see if anything can be done about it :)
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,560
Office Version
2016
Platform
Windows
I'm trying to figure out if it's a bug/loss of functionality with the software that hasn't been noticed..... or if the effects of ignoring DDE were simply coincidental before.
Hi Scotster,
I really don't know the answer... I use excel 2016 and IgnoreRemoteRequests works as expected.

You can also launch your workbook program from a small vbs file that may also work for you.

Regards.
 

Scotster

New Member
Joined
May 29, 2017
Messages
25
Hi Scotster,
I really don't know the answer... I use excel 2016 and IgnoreRemoteRequests works as expected.

You can also launch your workbook program from a small vbs file that may also work for you.

Regards.

Hmm, that's very interesting. Out of curiosity could you try this and let me know if it works (Just in case I'm doing something wrong)

Under Workbook

Code:
Private Sub Workbook_Open()
 Application.DisplayAlerts = False
 Application.Visible = False
 Application.IgnoreRemoteRequests = False
End Sub
F5 it to fire it and then open up any other Excel file.

For me, it not only un-hides the application but also opens it in the same instance.
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,560
Office Version
2016
Platform
Windows
Hmm, that's very interesting. Out of curiosity could you try this and let me know if it works (Just in case I'm doing something wrong)

Under Workbook

Rich (BB code):
Private Sub Workbook_Open()
 Application.DisplayAlerts = False
 Application.Visible = False
 Application.IgnoreRemoteRequests = False
End Sub
F5 it to fire it and then open up any other Excel file.

For me, it not only un-hides the application but also opens it in the same instance.
The IgnoreRemoteRequests Property should be set to TRUE not to FALSE

Code:
Application.IgnoreRemoteRequests = [COLOR=#ff0000][B]True[/B][/COLOR]
 
Last edited:

Scotster

New Member
Joined
May 29, 2017
Messages
25
The IgnoreRemoteRequests Property should be set to TRUE not to FALSE

Code:
Application.IgnoreRemoteRequests = [COLOR=#ff0000][B]True[/B][/COLOR]
Apologies, I meant true haha. Was just typing it off the top of my head.
 

Scotster

New Member
Joined
May 29, 2017
Messages
25
I've managed to find a way around this but I still think there's a bug with the software. My solution is to use a second WB to open the primary one using the excel object. I create a new excel application object, use that to open the primary file before closing and it works absolutely fine, just as expected.

Opening the file on its own results in the application becoming visible and the "ignoring" being ignored.
 
Last edited:

Scotster

New Member
Joined
May 29, 2017
Messages
25
Here is a tester that works to showcase the issue and solution (if you also have the same problem)

New workbook, inside the Workbook code..

Code:
Private Sub Workbook_Open()    
Application.IgnoreRemoteRequests = True
    Application.Visible = False
    Test.Show
End Sub
Create a "Test" userform with a Command Button


Code:
Private Sub CommandButton1_Click()    
Application.OnTime Now + TimeSerial(0, 0, 1), "Open_SezMe"
    Unload Me
End Sub


Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = 0 Then
        Application.DisplayAlerts = False
        Application.Quit
    End If
End Sub
Create a module with the following functions

Code:
Function Open_Link(StrPath, oNew)
Dim objExcel
Dim objWorkbook


    If oNew = True Then
        Application.DisplayAlerts = False
        Set objExcel = CreateObject("Excel.Application")
        objExcel.Visible = True
        Set objWorkbook = objExcel.Workbooks.Open(StrPath)
        Set objExcel = Nothing
        Set objWorkbook = Nothing
    Else
        CreateObject("Shell.Application").Open CStr(StrPath)
    End If


End Function


Function Open_SezMe()
    Application.WindowState = xlMaximized
    Application.Visible = False
    Application.DisplayAlerts = False
    Application.IgnoreRemoteRequests = True
    ThisWorkbook.ChangeFileAccess xlReadOnly
    addy = ThisWorkbook.FullName
    Open_Link addy, True
    Application.IgnoreRemoteRequests = False
    Application.Visible = True
    ThisWorkbook.Close False
End Function

When the file opens, attempting to open another excel file fails due to trying to open up in the same instance with a modal userform in place. This is normally mitigated using the "ignoreRemoteRequests" command, but this (as per my issue) is being ignored. In order to have it work as it should, click the button. It will re-open the file using the Excel Application Object, after which the "IngoreRemoteRequests" works as expected. Opening another Excel file will open in a new instance, leaving this particular little program alone.

This is exactly what I've had to do to get my program to run as expected. Have a 3rd party file use the above method to open the file I want exclusive.
 
Last edited:

Forum statistics

Threads
1,085,651
Messages
5,384,936
Members
401,927
Latest member
commae

Some videos you may like

This Week's Hot Topics

Top