VBA: Update Read-Only Workbook

JennV

New Member
Joined
May 9, 2019
Messages
34
Hello there,

I'm not sure if this is even a possibility... I'm hoping so!

Currently, in wb1, I have a macro that opens wb2 to update data and if wb2 is read-only, it will ExitSub. My concern is, wb2 will be accessed VERY frequently by other users so I’m wondering if I set wb2 as read-only to those users, is there a code that will allow me to still update data from wb1 despite of wb2 being read-only? For example, when I run the macro in wb1, it will temporarily take away the read-only function and then re-add it once I’m done updating it?

Thank you in advance!
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
You should be able to accomplish what you need by using SetAttr

SetAttr <full workbook name>, vbReadOnly will make the file read only
SetAttr <full workbook name>, vbNormal will give you read/write access
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,994
Members
452,542
Latest member
Bricklin

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