Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_ClipText to Array and/or Cusor
Message
From
23/10/2006 09:24:21
 
 
To
16/10/2006 17:49:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01162254
Message ID:
01163906
Views:
10
Thanks to all who replied to this question.

Here's what I'm working on. I constantly need do cut and paste info from VFP cursors into Excel spreadsheets. These are normally just one time efforts so I haven't tried Excel objects and used OLE to push the data into the spreadsheets.

I just need a simple cut & paste to work properly. I have absolutely no problems, if I cut & paste from Access to Excel. But using the _vfp.DataToClip(,,3) give undesired results. For instance, the default padded spaces added to each character field causes problems and, likewise, the extra blank column added to the block of data is an issue.

I've written a program that solves both of these two issues using code very similar to what Author shared. However, there is one last annoying issue. If a column contains a string that is all numbers, Excel formats the cell as numeric, even though all of the other data in the column is character based. For instance, SKUS like 112345-C1, 124R-52571, WRS2345890, all format properly as a character string. But, if the column contains a SKU, such as 000345633, it gets formatted as a number and the preceding zeros drop off. I can tell pretty quickly when this happens to a column of data, as the string data is left justified and the numbers are right justified. I can fix the problem by deleting the cut & pasted data from Excel, change the formatting of the column to "Text" and then re-paste the data back into the spreadsheet once again. Obviously, this is a step that I wish I did not have to deal with.

I've noticed that this doesn't happen when using the wizard to import the data because the type data is declared as character during the import wizard process. But, since I often have a lot of other data already loaded in the Excel spreadsheets, I'm trying to avoid the import process. If I can just get this one last issue resolved then the cut & paste process will work just fine for what I need.

Thanks,
Robert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform