Save Active Workbook in Read Only

jas21nz

New Member
Joined
Sep 29, 2010
Messages
3
Hi There

I have created a macro that ends with activeworkbook.save

I was wondering if it is possible, when opened in read only mode, to ignore the save. This is to avoid the prompt asking the user to save when the macro is run.

Note that this macro is autorun when the user opens the file with the following:

Private Sub Workbook_Open()
Call Macro9
End Sub

Maybe it is a matter of changing this?

When I get this macro running it will be awesome! I will be able to track the user's username and time they opened the file without them knowing!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Use
Application.DisplayAlerts = False before and
Application.DisplayAlerts = True after.

NB. Make sure that the =True is immediately after the save.
If the code is interrupted while = False the setting remains until changed with code. So no messages are given at all, even after closing the workbook.
 
Upvote 0
Hi there

That works great.

However, the readonly text next to the file name diappears. Can this be put back on again?

What I am effectively doing is allowing it to open in read only mode, saving the user's username in a hidden sheet, and putting it back in read only mode.

NB: Even when the message diappears, if the user saves the file it wont actually save (which is OK)
 
Upvote 0

Forum statistics

Threads
1,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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