Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pasting in Excel occasionally randomly fails
Message
From
23/10/2014 13:05:26
 
 
To
23/10/2014 11:10:09
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01609799
Message ID:
01609813
Views:
49
Well, actually, I can't do that. I restore the clipboard after using it, so there's no evidence left.

As this problem occurs in any of a number of applications, I would have to recompile all of them.

Furthermore, the actual code is:
Select(lcExportAlias)
Goto Top
DataToClip(lcExportAlias)
So I know I am always atop the cursor.

I am sure something else is going on here.


>Then I would suggest that next time this operation fails you (or your user) paste the data into Notepad to see what it's being sent to the clipboard.
>
>
>>No, there is no issue here with the record pointer. If it were, it would be reproducible.
>>
>>DataToClip is actually used on a new cursor that is created for export, and the record pointer is at the top of that cursor.
>>
>>
>>
>>>>In all my grids throughout all my applications, the user can export any grid to Excel so that it looks, as much as possible, like the original grid. This is something that has been available for years and is used extensively.
>>>>
>>>>Every once in a blue moon, a user will report that the spreadsheet was created properly, with all headings and cell decorations, but without any data.
>>>>
>>>>The data is pasted in with copy that looks essentially like this:
>>>>
DataToClip(Alias)
>>>>loExcel.ActiveSheet.Paste()
>>>>
>>>>The user may repeat it a few times, failing each time, until, eventually, it works. It has happened to me twice. The most recent report was from somebody who exports from the same grid daily.
>>>>
>>>>Does anybody have any idea about what might be going on and what I could do about it?
>>>>
>>>>Thanks
>>>
>>>The scope of records that DataToClip sends to the clipboard is equivalent of REST. If Alias record positon is beyond EOF, then no records are sent to the clipboard. Are you controlling Alias record position before copying the data?
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform