Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hex values converted to exponents during Excel Automatio
Message
De
29/01/2004 10:32:07
 
 
À
29/01/2004 03:54:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00871210
Message ID:
00871809
Vues:
31
*snip*

>Format the column as text. ie:
>
>Local Array arrVals[3]
>arrVals[1] = '2E63'
>arrVals[2] = '30E8'
>arrVals[3] = '30E7'
>oExcel = Createobject('excel.application')
>With oExcel
>  .WorkBooks.Add
>  With .ActiveWorkBook.ActiveSheet
>    .Range('B:B').Numberformat = '@'
>    For ix=1 To 3
>      With .Range('A'+Transform(m.ix)+':C'+Transform(m.ix))
>        .Columns[1].Value = m.ix
>        .Columns[2].Value = m.arrVals[m.ix]
>        .Columns[3].Value = m.arrVals[m.ix]
>      Endwith
>    Endfor
>  Endwith
>  .Visible = .T.
>Endwith
>
PS: Setting excel values cell by cell should be a killer. HAve you ever thought of copying data to clipboard and paste, or copy to csv,fox2x dbf,text and get from excel.
>Cetin

Hi Cetin,

The NumberFormat = '@' thing was exactly what I was looking for.

Recreating the report in Excel via automation was not fun, however, it was a learning experience and the reason for the cell by cell creation is due to the way the customer wants the spreadsheet. They also tend to request a lot of changes. I'll take a look at the copy and paste idea though as it very well may be a better solution or work for other problems.

Thanks for the ideas. :)
---------
Single field, surrogate primary keys....because it's sexier!

Third normal form is more than just a good idea.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform