Ignore Remote Requests not sticking when opening a new Workbook.

Tazyote

New Member
Joined
Jan 14, 2014
Messages
14
Hello, :)

I have this nifty macro that I use to launch a userform and hide the workbook. Before I went to Excel 2013, it worked great. Since then, every time I launch Excel (only the program, not individual workbooks), the userform and the Workbook close. Because they were forced closed by the opening of the Excel Icon, the next time I try to launch Excel, the Ignore Remote Requests box is checked and I have to go into advanced options and uncheck the box before I can use Excel again.

I have two questions:

1) I could only think of using a sub for the Workbook of "Before Close" to deactivate the ignore remote requests but when this workbook is shut down, as outlined above, this macro does not get a chance to run. Is there a better way to ensure the macro is run?

2) Can any of you think of a way to prevent the workbook from forcibly shutting down whenever Excel in launched from the desktop Icon? I had hoped the "ignore remote requests" command would be enough, but it does not seem to be. Any ideas would be appreciated.

In any case, here is the code I have for the workbook that opens and closes while hiding the worksheet. If no answer is found, hopefully someone can find use for the code in their own projects.

Code:
Private Sub Workbook_Open()
Application.OnTime Now, "thisworkbook.onlyoneofme"
End Sub
--------------------------------------------------------------------------------------
Private Sub onlyoneofme()
Dim xlapp As Excel.Application
On Error GoTo bad
With Application
If Me.ReadOnly Or .Workbooks.Count > 1 Then
Me.ChangeFileAccess xlReadOnly
Set xlapp = New Excel.Application
xlapp.Workbooks.Open (Me.FullName)
GoTo bad

Else

.Visible = False 
.IgnoreRemoteRequests = True
"USERFORM1".Show

End If
Exit Sub
End With
bad: If Err Then MsgBox Err.Description, vbCritical, "ERROR"
Set xlapp = Nothing
Me.Close False
End Sub
--------------------------------------------------------------------------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Application.IgnoreRemoteRequests = True
Application.ThisWorkbook.Close True
Application.Visible = False
Application.Quit

End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top