Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clear Office Clipboard
#1
I am copying data out of an Excel Spreadsheet and pasting into another application and Excel only allows me to copy 12 bits of data before I receive and error saying the clipboard is full. I have found a registry edit that removes the Office Clipboard, however, I am wondering if there is another way of storing the data in a variable rather than using the clipboard.

Awesome program - registration on its way.
#2
Excel can be controlled programmatically. Following example displays all selected cells.

Code:
Copy      Help
;declare Excel type library (use 'Type libraries' dialog in Tools menu)
typelib Excel {00020813-0000-0000-C000-000000000046} 1.2
#opt dispatch 1 ;;call functions through IDispatch::Invoke (may not work otherwise)
;connect to Excel (must be running) and get active sheet
Excel.Application xlApp._getactive
;get selection and number of selected cells
Excel.Range r=xlApp.Selection
int i j ncells=r.Count
;raw display
for i 1 ncells+1
,out r.Item(i)

;display formatted as table. Must be selected 3 columns.
str s s1 s2 s3
for i 1 ncells/3+1
,s1=r.Item(i 1)
,s2=r.Item(i 2)
,s3=r.Item(i 3)
,s.formata("Row %i:  %s  %s  %s[]" i s1 s2 s3)
out s

Excel programming reference can be found in Excel help. It is not part of default installation, but can be installed later.


Forum Jump:


Users browsing this thread: 1 Guest(s)