By using vba.booksticle.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

948 Steps to 6 Figures by Learning Excel-VBA and Other Skills



Step 347 - SetAttr


This command can be useful for setting a file to read-only. If you don't want others who edit a file to lock it so you can't change it, it's better to set the file to read-only when you're not processing it.

When you process the file turn off the read-only and then after you finish turn it back on

SetAttr sfilename,attrbute

where attribute can be
  • vbReadOnly
  • vbNormal
  • vbArchive
  • vbSystem
  • vbHidden
  • vbDirectory

  •    Table of Contents | Send us your feedback | © 2025 All Rights Reserved | Edit