To retain the protection, the workbook must be protected. The macro recorder gave me this line:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
In VFP, it would be ActiveSheet.Protect(.T.,.T.,.T.).
Your users will still be able to turn off the protection in Excel if the workbook is exposed to them. If it is possible, keep Visible = False.
Hope this helps.
Tom Molloy
>Hi All,
>
>I am developing a few reports using Excel and VFP/VB. I'm exporting data to Excel from my VFP tables. After I export, I'm setting "EnableSelection" property of Excel Sheet to "xlNoSelection", after protecting my WorkSheet.
>
>Main intention is to restrict users from Copying Data from the WorkSheet. It works well when I'm running my code and viewing it as an object. However once I save and open again, the EnabledSlection property is getting reset to the original value "xlNorestrictions".
>
>Is there any way I can set this property permanantly. Or is there any other way to prevent users from copying data from an Excel Sheet.
>
>I'm deparatly looking for an answer, I'll appreciate any help in this.
>
>
>TIA
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement