Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to an excel file
Message
From
27/05/2011 13:12:39
 
 
To
12/05/2011 12:21:56
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01510189
Message ID:
01512075
Views:
40
Scott:

I've got SHEET protection on every sheet, not workbook protection.

Yossi

>Yossi:
>
>Password protection is pretty easy to do when you save the worksheet. I haven't tried unprotecting a sheet but suppose it could be done.
>
>Scott
>
>
>#INCLUDE ..\Excel.h
>goExcel = CREATEOBJECT( "Excel.Application" )
>goExcel.Visible = .T.
>WITH goExcel
>    .SheetsInNewWorkbook             = 1
>    .Workbooks.Add 
>    .ActiveSheet.Name                = "MySheet"
>    .ActiveWindow.DisplayGridlines   = "TRUE"
>    .ActiveWindow.DisplayHeadings    = "TRUE"
>    .Application.DisplayFormulaBar   = "TRUE"
>    .ActiveSheet.EnableCalculation   = "TRUE"
>    .Cells.Font.Name                 = "Arial"
>    .Cells.Font.Size                 = 10
>    .Columns("A:A").NumberFormat     = "@"
>    .Cells( 1, 1 ).Value             = "Going to password protect this sheet."
>    .Cells( 2, 1 ).Value             = "The password, for what it's worth is Pa$$w0rd"
>    *                        File Name       Format     Password
>    .ActiveWorkbook.Saveas( "testPassword", xlExcel7, "Pa$$w0rd"  )
>ENDWITH
>RELEASE goExcel    
>
Previous
Reply
Map
View

Click here to load this message in the networking platform