Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hex values converted to exponents during Excel Automatio
Message
De
27/01/2004 20:16:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
27/01/2004 19:08:53
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00871210
Message ID:
00871228
Vues:
14
>I have the need to send data to an Excel spreadsheet. I'm using automation to write the values out to the spreadsheet but one of the rows of data is a four digit hexadecimal number which is sometimes interpreted by Excel as a exponential expression.
>
>I've tried to find a way to Excel to format that column/range of cells as text but either the answer is hidden well or the lack of sleep has caused me to miss the answer in the Excel help file and Office Automation with Visual Foxpro book by Tamar Granor and Della Martin.
>
>The current, mostly working bit of code...
>
>
>      .Columns[1].value  = lnPartCnt
>      .Columns[2].NumberFormat = '00##'
>      .Columns[2].value  = CastHist.SerialNo
>      .Columns[3].value  = CastHist.MastHeat
>
>
>Examples of the hex data that is converted...
>2E63
>30E8
>30E7

The "E" is interpreted as "exponent", as you are probably aware.

If you want to have Excel accept this as text, you can use Cell.Value = ['] + "2E63", for instance. That is, start with a single quotation.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform