Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to format a range of cell with numbers as text
Message
De
26/05/2008 15:05:54
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
 
 
À
26/05/2008 14:20:38
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01319538
Message ID:
01319548
Vues:
24
I found the solution
oExcel.ActiveSheet.Range("C14").NumberFormat = "@"
>Hi!
>A friend asked me how to format some cell's as text.
>
>He needs to store some cells with some values that can be numeric, alplanumeric ou text like: "0345", "34e12" or "a345"

>The main problem is that another software his client has will read those values and it only understand those value as text, so it's not allowed to use a apostrophe in front of any value, because it would change the value for the other software.
>
>I tried to format the cell in a test
>
>oExcel = CreateObject("Excel.Application")
>oExcel.Visible = .T.
>oBook = oExcel.Workbooks.Add()
>oExcel.ActiveSheet.Range("C14").NumberFormat = "00000000000000"
>oExcel.ActiveSheet.Range("C14").Value = "05041910505374"
>oExcel.ActiveSheet.Range("C15").NumberFormat = "00000000000000"
>oExcel.ActiveSheet.Range("C15").Value = "05044"
>
>
>In this case the propertie NumberFormat doesnt work
>Is there another solution form this problem.
>
>Any Ideas?
>
>TIA
>
>Peter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform