Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Protect a Column in Excel file
Message
From
23/05/2001 06:03:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/05/2001 04:19:40
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00510219
Message ID:
00510237
Views:
11
>Hi,
>
>now i know how to modify a Excel file from VFP programming.
>
>i want to know the command for protect a COLUMN in EXCEL.
>
>for exp. the Column A is stored list of Item number,
>i don't want any user can modify it ( Column A only )
lcXLSName = sys(5)+curdir()+'customer.xls'
Select * from customer into cursor myCursor
Copy to (lcXLSName) type xls
oExcel = createobject('Excel.Application')
With oExcel
  .Workbooks.Open(lcXLSName)
  With .ActiveWorkBook.ActiveSheet
    .Cells(1,1).CurrentRegion.Locked = .F. && Set locked to .f. for all
    .Range('A:A').Locked = .T. && Lock first column
    .Protect('pw') && Enable protection with password pw
  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
Reply
Map
View

Click here to load this message in the networking platform