Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exporting data file into excel read only

    Hello,

    After running my do file, I want to export the manipulated data set into excel, however I want the excel file to be read only. Is there a way to do that through the command line in stata? This is the code I have:

    Code:
    export excel "$out\mainpulated_data.xlsx", sheet("master") firstrow(variables) replace
    Thanks!

  • #2
    You could use Stata's -shell- command (-help shell-) to give a command to your operating system to declare that file as read-only after creating it. On Windows, for example, you could do this:
    Code:
    export excel "$out\mainpulated_data.xlsx", sheet("master") firstrow(variables) replace
    shell attrib +r "$out\mainpulated_data.xlsx

    Comment


    • #3
      This works, thank you!

      Comment

      Working...
      X