Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date formats in Excel
Message
De
25/09/2007 07:53:35
 
 
À
25/09/2007 07:38:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01256582
Message ID:
01256587
Vues:
18
This message has been marked as the solution to the initial question of the thread.
>Hi
>
>I am trying to write a copy/paste routine of data in a cursor to Excel. I am using Excel automation to do this; open an instance of Excel, create a new worksheet, copy my cursor to the clipbaord using _VFP.DataToClip(), paste into Excel. Everything is fine but the dates seem to be all messed up with the year appearing first sometimes, then at the end, and other combinations. It would appear that Excel does not recognize the date format being pasted.
>
>How can I copy to clipbaord and paste into Excel and ensure my dates format correctly in YYYYMMDD format (or other of my choosing)?
>
>Thanks


Jos,

To get around the date troubles, convert the dates so that excel will be receiving a function as a field/cell
	create cursor ppp (aa c(20), bb c(30), cc i)
	insert into ppp values('=date(2007,10,10)', 'jos', 1)
	insert into ppp values('=date(2007,11,11)', 'jos', 2)
	go top
	?_vfp.datatoclip(,,3)
         && now paste into excel
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform