Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing Date field back from Excel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01097500
Message ID:
01097529
Vues:
10
>>>Hi
>>>I create an excel file from my file ( copy to ... type xl5 ). After some work on the worksheet, i want to update my table back. It keeps erroring in the date field when bringing it back. Is there an easy way to achieve this without creating a date string, importing there then moving it from VFP?
>>>
>>>Thanks
>>>Jaime
>>
>>Hi Jaime,
>>
>>It depends on what is going on with "some work on the worksheet", and you "update my table back". I do not think that you will see errors with the plain calls like:
>>
>>copy to (ExcelFile)... xl5
>>append from (ExcelFile) xl5
>>
>>What are errors related to yours "keeps erroring in the date field"? And what are you doing with the information in Excel file?
>
>Well the application scans the worksheet ( i.e for each row ) and does a REPLACE command on the table. When replacing VFPDateField with ExcelDateField i get an error. I tried running stuff like .Range('D:D').NumberFormat='dd-mm-yyyy' but still no go.
>
>Jaime

And there is another similar question, what do you mean, "replacing VFPDateField with ExcelDateField"? What is ExcelDateField?

Anyway, I doubt you would have problem following scenario like this:
create curs yy (fldt, D)
insert into yy values (date())
copy to c:\yy xl5

oExcel= CREATEOBJECT("Excel.Application")

with oExcel
	.DisplayAlerts = .f.
	.Visible=.t.
	.Workbooks.Open("c:\yy.xls")
ENDWITH
......

REPLACE fldt WITH OExcel.Activesheet.Cells(2,1).value
.....
Still it is not quite clear what do you mean, "some work on the worksheet", which may also be critical to derive the answer to your original question.
Do you change formattings of the cells, insert something manually, or what?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform