Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling Paste format for Excel
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00745161
Message ID:
00745190
Views:
17
You need to format cells in the column prior to paste. Something like:
....
ObjExcel.Activesheet.Columns("A:A").Select
ObjExcel.Selection.NumberFormat = "@"
_VFP.Datatoclip(,10,3)
ObjExcel.ActiveSheet.Paste()

>I am using OLE to paste some items from the clipboard into excel (using Cetin's Table2Clipboard program to get it to the clipboard). When I paste it into Excel, character fields that start out with numbers get interpreted as numbers or dates. For example, if the clipboard has
>
>
>CATEGORY	QUANTITY
>	        7
>2000:8.2	7
>2000:4.1	2
>2000:5.6	2
>.NULL.	        1
>2000:5.4	1
>
>
>That will get pasted into Excel and turn into:
>
>
>CATEGORY	QUANTITY
>	            7
>20:08.2	            7
>20:04.1	            2
>20:05.6	            2
>.NULL.	            1
>20:05.4	            1
>
>
>where the first entry 20:08.2 is really 1/1/1900 9:20:08 AM!!!! If I manually try paste special -- text , it still doesn't work. Do any of you have any thoughts on the subject?
>
>Thanks,
>
>Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform