Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automation - Protect Worksheet
Message
De
16/11/2003 19:25:42
 
 
À
15/11/2003 08:47:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00850221
Message ID:
00850515
Vues:
15
Thanks Cetin,

My problem was trying to set the protect property (protect = .T.) rather than calling the protect function protect(mypassword)

Ken

>>Hi,
>>
>>I have successfully automated the process of creating physical inventory count sheets and a 'master' roll up worksheet in an Excel Work Book. I just need one more thing... How do I "protect" the work sheets so that the users can enter data in only the actual count column?
>>
>>I was able to "unlock" those cells but I cannot seem to "protect" the work sheets.
>>
>>Thanks,
>>
>>Ken
>
>
>Use orders
>lcXLS = Sys(5)+Curdir()+'orders.xls'
>Copy To (lcXLS) Type Xls
>lcLastColumn = Chr(Asc('A')-1+Fcount()) && Last col not locked
>
>oExcel = Createobject('Excel.application')
>With oExcel
>  .Workbooks.Open(lcXLS)
>  With .ActiveWorkbook.ActiveSheet
>    .UsedRange.Locked = .T.
>    .Range(lcLastColumn+':'+lcLastColumn).Locked = .F.
>    .Protect('mypassword')
>  Endwith
>  .Visible = .T.
>Endwith
>
Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform