Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automation - Protect Worksheet
Message
From
15/11/2003 08:47:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/11/2003 08:16:31
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00850221
Message ID:
00850224
Views:
22
This message has been marked as the solution to the initial question of the thread.
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform