Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open Excel as readonly
Message
De
02/02/2004 09:11:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00872785
Message ID:
00872910
Vues:
18
>My first attempts at reading Excel from VFP. While I'm debugging, sometimes when the program crashes, it leaves the Excel worksheet in a readonly state. That's fine for the VFP program, since I'm only reading it. But it means I can't go to Excel and change my test data. Once its readonly, I have to reboot to clear the problem.
>
>It seems I should open the worksheet as ReadOnly but I don;t have info on how to do this.
>
>I have
>
>oExcel=CreateObject("Excel.Application")
>oWorkbook = oExcel.Workbooks.Open(thisform.xlsname)

The third parameter to the Open method determines whether it's read-only or not. Do be aware, though, that Office's interpretation of read-only isn't exactly what you might think. It prevents you from saving it back to the original file, but doesn't prevent changes or a SaveAs.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform