Is there a way to save an Excel file as Read-Only?

Is there a way to save an Excel file as Read-Only via VBA?

NOT, "Read-Only Recommended," but rather actually "Read-Only" in the file properties.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Right click the file, modify all user securities to "read only"

They will be able to save a copy, but that file is read only.
HaimDAuthor Commented:
Need it via VBA
Kamaraj SubramanianApplication Support AnalystCommented:

To make a Excel file read only (Microsoft Excel 2003),

    * Goto Tools ->Options->Security (The Tools menu in the worksheet menu bar)
    * Check the READ-ONLY RECOMMENDED box.

This would make your file read only and when the file is opened, it would prompt you with the message box whether you want the file to be opened in read only mode or not. If you click YES, the file would open in read only mode. If you click NO, the file would open in read write mode and you can save your changes.

For Microsoft Excel 2000 and other previous versions

    * Goto File->Save As
    * Click the TOOLS button on the right corner and select GENERAL OPTIONS
    * Now check the READ-ONLY RECOMMENDED box.

This works well in Microsoft Excel 2003 also.

The above option, though making the file read only, gives the user the option to edit it. So even if an user unknowingly presses the NO button , when prompted for read only opening, he may still be able to edit the file. If you want to prevent this then,

    * Navigate to your file through Windows Explorer or the File Open Box and select it.
    * Check the READ ONLY box.

This always open the file read only and even if you already made your file read only, by using the first option, this overrides it since this function is part of the operating system rather than the application. To make the file read write again, just uncheck the READ ONLY box.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

ActiveWorkbook.SaveAs Filename:=FN, ReadOnlyRecommended:=True
HaimDAuthor Commented:
Need Read-Only via VBA.  Not read-only recommended via checkbox.
HaimDAuthor Commented:
That's ReadOnlyRecommended...need Read-Only
Something likethis

SetAttr pathname, attributes

To set ReadOnly=True
SetAttr "C:\Blank.xls", vbReadOnly

To set ReadOnly=False
SetAttr "C:\Blank.xls", vbNormal

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SetAttr "C:\Blank.xls", vbReadOnly
If you guys are going to copy from another site, I would reccomend giving that site the credit.......
Then why post the question if the answer is easily found?
going along with that these guys provided, you could also use
setattr thisworkbook.fullname, vbreadonly
thisworkbook.close true
If this person pays to use this site, I would also come here first.....
Just saying, it's always recommended to give credit where the solution is found.....or either link to it......
When I answer questions, I assume that the poster has already done a quicky google search.
Which is true, thereby the source:
HaimDAuthor Commented:
Exactly what I needed.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.