Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hidden columns in Excel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01146393
Message ID:
01146530
Vues:
16
>O! Then you must select whole sheet or only used range to Unlock all cells and then lock only header row.

Yep, this worked:
if m.tlLockHeaderRow && we need to prevent headers from modifying
			** Code from Borislav Borissov
			loSheet.UsedRange.select
		    loExcel.Selection.Locked = .f. && First we need to UNLOCK all cells
		    loExcel.Rows(m.lnLines + m.lnOffset).Select && Select header row of the sheet
 		    loExcel.Selection.Locked = .t. && Lock Cells in first row
			loExcel.ActiveWorkbook.ActiveSheet.Protect(,.t.,,.t.)
    endif 	
And it's good I posted because I see I have wrong comments on the loExcel.Selection.Locked = .t. line.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform