Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clipboard copying from excel
Message
 
À
23/07/2011 09:52:13
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01518978
Message ID:
01518999
Vues:
54
Thank you very much Gregory.

The advantage of using the Clipboard is performance. The copy function dumps the range into a string in vfp, the cells are separated by tabs (Ascii 9) (not checked how rows are separated, but that's easy to find out). Was just hoping someone had already written a function that de-compiles that.

Take care and kind regards,

Marc


>Write a function ?
>
>
>local aa[1]
>= RangeToArray(@m.aa, m.o.range("myRange"))
>
>
>
>&& First possibility
>
>*_______________________________________________________________________________
>function RangeToArray(aa, rangeObj)
>	
>	local i, j
>	
>	with m.rangeObj
>		dime aa[.Rows.Count, .Columns.Count]
>	
>		for i = 1 to .Rows.Count
>			for j = 1 to .Columns.Count
>				aa[ m.i, m.j] = .Cells(m.i, m.j).Value
>			endfor
>		endfor
>	
>	endwith
>
>endfunc
>*_______________________________________________________________________________
>
>
>
>
>Second possibility
>
>function RangeToArray(aa, rangeObj)
>	
>	with m.rangeObj
>		dime aa[.Rows.Count, .Columns.Count]
>		local bb
>		
>		bb = .Value
>		
>		=acopy(bb, aa)
>		
>	endwith
>
>endfunc
>*_______________________________________________________________________________
>
>
>>Is there a way to get the string in c that I get from
>>
>>o.range("myRange").copy()
>>c = _cliptext
>>
>>into an array, with or without having to iterate through the string?
>>
>>Btw a cursor would work for me as well :) .
>>
>>o is the Excel.application. .
>>
>>Thanks.

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform