SaveAs Read Only

PoggiPJ

Active Member
Joined
Mar 25, 2008
Messages
330
I have a large complex workbook containing many ranges of product line items. The line items consist of both unprotected (i.e. PartNumber, Quantity) and protected (i.e. price x quantity formula) cells.

Once the order is complete, I would like to offer the ability to save a completely Read Only copy that can be sent on for processing, where nothing, even the unprotected Part Number or Quantity cells, could be changed from that point on.

Using Excel 2003, is there a simple way to accomplish this for the entire workbook using a SaveAs Read Only or other option? Or, will I need to create a command button macro that specifically changes each line item's cell attributes to Protected?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try like this

Code:
Sub atest()
ActiveWorkbook.SaveCopyAs Filename:="C:\test.xlsm"
SetAttr "C:\test.xlsm", vbReadOnly
End Sub
 
Upvote 0
Thank you VoG,
It runs through without error, but when I go to open the saved file I receive a "recommendation" to open as Read Only, with two options.

Yes) Open it as read-only: When I select this option, nothing is changed. I can still enter data into previously unprotected cells.

No) I don't want the user who receives this file to have this option. They need to receive an absolutely read only file.

I suspect that my worksheet handling macros that control protection are overriding the vbReadOnly attribute.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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