Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem inserting date into Excel Sreadsheet
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00809556
Message ID:
00809568
Vues:
29
>Gregory
>
>Courtesey of Cetin Basoz
>
>Drop a web browser control into a ole container on a form, then put this code into the click event of a button
>
>nodefault
>With thisform.OleControl1
> .Navigate2('file://c:\global\mertest.xls')
> Do While .ReadyState # 4 && Wait for ready state
> EndDo
>endwith
>
>oXLS = thisform.OleControl1.object.document
>oExcel = oXLS.Application
>
>* This code builds a table called mertest with data laid out as I want to see it on the spreadsheet.
>do merrtestlonytd

I think that merrtestlonytd() must format the dates

I just created a cursor with a c(20) field.
The contents of the field were '=date(2002,1,1)'
did a _VFP.DataToClip(,,3)
pasted into excel
positioned on the paste cell and saw =DATE(2002,1,1)

Can you change merrtestlonytd() so that date fields become chars
Should work as far as I can see


>* Then copy and paste it into an excel worksheet template (with 4 graphs which show when the data is pasted)
>
>select mertest
>with oExcel.ActiveWorkBook
> .WorkSheets('LON YTD').Activate
>oExcel.ActiveWorkBook.ActiveSheet.Range("c8").PasteSpecial()
>endwith
>_Cliptext = "" && Empty clipboard
>oExcel.Application.ActiveWorkbook.Save()
>
>Works great
>
>
>Colin
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform