Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify "view only" setting of XLS file #51

Closed
jsangradorp opened this issue Sep 13, 2017 · 6 comments
Closed

Modify "view only" setting of XLS file #51

jsangradorp opened this issue Sep 13, 2017 · 6 comments
Milestone

Comments

@jsangradorp
Copy link

Hi! This is more of a feature request, so please feel free to ignore and/or close it 馃槃

I would like to be able to set an XLS file to view only mode, from the command line, so as to script it for a full directory tree.

Thanks for considering!

@tobya
Copy link
Owner

tobya commented Sep 13, 2017

Thanks for the issue @JSangrador

If I get you right you would like to open each file in a dir tree modify the view only setting of the file and then resave?

If so, I think that's sort of outside the primary scope of DocTo or XLSTo, but I'll take a look.

@jsangradorp
Copy link
Author

Yes that is the idea. I understand it is outside the primary scope of XLSTo, but thanks a lot for considering 馃槃 .

Although the directory traversal could obviously done outside, of course.

@tobya
Copy link
Owner

tobya commented Sep 13, 2017

It is an interesting idea though so I'll look into it when i get a moment

@tobya
Copy link
Owner

tobya commented Sep 16, 2017

@JSangrador I'm not sure I understand the exact setting you are asking for. Could you let me know what you do to set this value manually, or if you have a microsoft documenation page that explains the value setting that would be helpful.

@jsangradorp
Copy link
Author

The thing is I am looking into this on behalf of a relative and me myself I never use Excel myself! Add to that his Excel is in Spanish. He says he opens a file, and inside the "Review" ("revisar") "tab" there is a "protect sheet" ("proteger hoja") option and a "protect book" ("proteger libro") option, and he says that any of the two options is good for him. I hope that helps.

@tobya
Copy link
Owner

tobya commented Jan 12, 2020

I've recorded a macro for this to look ar the code that is used

Sub protect()
'
' protect Macro
'

'
    ActiveSheet.protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingCells:=True, AllowFormattingColumns:=True, _
        AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
        :=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True
    Range("S20").Select
    Sheets.Add After:=ActiveSheet
    Sheets("Sheet2").Select
    Sheets("Sheet2").Name = "Workbook2"
    ActiveWorkbook.protect Structure:=True, Windows:=False
End Sub

@tobya tobya added this to the V1.3 milestone Feb 2, 2020
@tobya tobya modified the milestones: V1.3, V1.4 Jun 21, 2020
@tobya tobya modified the milestones: V1.4, V1.6 Jul 26, 2021
@tobya tobya modified the milestones: V1.6, Long Finger, V1.7 Dec 2, 2021
@tobya tobya modified the milestones: V1.8, V1.84 Sep 6, 2022
@tobya tobya closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants