Preventing new Workbooks

JSussina

New Member
Joined
Oct 27, 2010
Messages
5
I have an issue with new workbooks opening in a spreadsheet that I have created. I've done plenty of searching, and have only 1/2 solved the problem. I have found the following code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.IgnoreRemoteRequests = False
End Sub

Private Sub Workbook_Open()
Application.IgnoreRemoteRequests = True
End Sub

Which works perfectly, except for 1 problem. My office uses a sharepoint for verious projects, and when the sharepoint is loaded it forces itself into my file even though, per the coding above, it shouldn't. When this happens it interupts a piece of code that is looped and I get a debug error. Any help would be GREATLY appreciated.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
One thing I've discovered... The ignoreremoterequests works great for preventing workbooks from being opened into your file, but once you are in you can open new files, thus discrupting the code. This seems to be what the sharepoint is doing.. it is locating the invisible file, then making it active and then opens the new file in that instance. Is there a way to disable new/open workbooks in excel, so it is truly a stand-alone file?
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

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