Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem populating a VFP table with an Excel 'date' fiel
Message
De
03/03/2000 13:13:26
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00340955
Message ID:
00341343
Vues:
22
I'm not sure. Date1904 is a boolean property of a Workbook object. The example in the Excel 2000 Language Reference is "ActiveBook.Date1904 = True". If you are using an earlier version of Excel,perhaps that property doesn't exist. If not, then skip that part and try one of the two date calcs. I believe the default is 01-01-1901+Serialno. Try it.



>> Thats the serialize data value. First off, you have to figure out which date > system is being used, then convert:
>
>> WITH oExcel.ActiveBook
>> IF .Date1904
>> dDate={^1904-01-02}+VAL(.ActiveCell.FormulaR1C1)
>> ELSE
>> dDate={^1901-01-01}+VAL(.ActiveCell.FormulaR1C1)
>> ENDIF
>
>Thanks for the help, I'm sure that the answer is near but I'm still having problems. Here is my code:
>
>oExcel= CREATEOBJECT("Excel.Application")
>WITH oExcel
>.DisplayAlerts= False
>.workbooks.open(thisform.FileName)
>.Range("C6").Select
>
>If I use this code:
>IF .Date1904
>I get "OLE error code 0x80020006: Unknown name."
>
>If I use this code:
>IF .ActiveBook.Date1904
>I get "Member ACTIVEBOOK does not evaluate to an object."
>
>If I use this code:
>IF .WorkBook.Date1904
>I get "Member WORKBOOK does not evaluate to an object."
>
>Am I possibly missing something in my header file?
>
>Thanks
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform