How to disable "notify" button?

honia

New Member
Joined
Oct 24, 2005
Messages
4
Hi all,

I am trying to prevent my users from opening the second copy of a file that is already open by disabling Save, Save As and it works perfect, so now, the first person opens the Excel file and when another users try to open the file by clicking on Read-Only button, they CAN'T save or Save As the file, now I need a function that disables the "Notify" button. I understand I need to set value of Notify to false, but I don't know how, please help :)

Thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to MrExcel Board!

If you set Notify to False when you open the file, the notification option is disabled.

See the Open Method in the VBA help for more details, or post back (with code) if you have problems doing this.

Hope that helps!
 
Upvote 0
Thanks Tazguy for your reply, here is my code below, I want to add something to it that disables or omit the notify button. as you see program checks to see if the file is read-only and then disables Save As option, I want it to check to see if the file is already open, if so, shows theat default warning message Read-Only, Notify, Cancel but without Notify or disable the notify. Here is my current program:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If ThisWorkbook.ReadOnly = False Then Exit Sub
Cancel = True
MsgBox "You are not allowed to save this read-only file.", 48, "New Media Strategies"
End Sub


I understand that I need to change notify value to False based on this instructionMSDN gives us, but don't know how, here is the instruction I found on MSDN but I need to know how you "actually" write that.

ThisWorkbook.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)

Notify:Optional Variant. If the file cannot be opened in read/write mode, this argument is True to add the file to the file notification list. Microsoft Excel will open the file as read-only, poll the file notification list, and then notify the user when the file becomes available. If this argument is False or omitted, no notification is requested, and any attempts to open an unavailable file will fail.

Thanks in advance
 
Upvote 0
honia said:
I understand that I need to change notify value to False based on this instructionMSDN gives us, but don't know how, here is the instruction I found on MSDN but I need to know how you "actually" write that.

ThisWorkbook.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)

Notify:Optional Variant. If the file cannot be opened in read/write mode, this argument is True to add the file to the file notification list. Microsoft Excel will open the file as read-only, poll the file notification list, and then notify the user when the file becomes available. If this argument is False or omitted, no notification is requested, and any attempts to open an unavailable file will fail.

How are you opening the file?
 
Upvote 0
I go to Excel and click on open, then I click on the file and open it from there, the file is on the network, so, the second person will open the file and gets that Read-Only notify, Cancel that I want to disable that Notify button.

I need to get this macro to work before Excel opens the file, something like before_open sub and tests to see if someone else has it open, then disables it. I have this program that is supposed to work, but doesn't work:

Workbooks.Open fileName:="C:\temp1\AllParms.xls", Notify:=False

Thanks for your PM as well
 
Upvote 0
Thanks, I saw that before, see that message box, it's got 3 button, Read-Only, Notify, Cancel, I want to disable that Notify button, then if the file is in used by the first person and the second person opens it, she/he will see this message box BUT without Notify button.
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,228
Members
453,025
Latest member
Hannah_Pham93

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