Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Writing to an excel file
Message
De
12/05/2011 12:21:56
 
 
À
11/05/2011 12:46:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Divers
Thread ID:
01510189
Message ID:
01510483
Vues:
49
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    
Scott Ramey
BDS Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform