Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date formats in Excel
Message
From
25/09/2007 09:16:00
 
 
To
25/09/2007 07:53:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01256582
Message ID:
01256614
Views:
13
>>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
>
Thanks Gregory. This works for me.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform