#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default clipboard

with "copy/paste" [say some range], does excel use clipboard, or some
internal structure?
after "copy", is it possible to somehow access that buffer [before "paste"],
and to examine it, or even programaticaly select [or apply] just a part of
buffer.
it is something like "paste special" does, but i would like to have *full*
[free] user intervention.
it would be also intersting to programaticaly [freely] *fill* that
"copy/paste" buffer.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default clipboard

well...

Clpbrd.exe will tell you what's on the clipboard.
copy a cell and check it out.

Be sure to use the View dropdown to see all the datatypes
such a 'basic copy' puts in the clipboard.

Freely filling the clipboard cannot be easily done VBA,
you'll need to use API's for that and it will be very complex
if you go beyond the very basic (documented) datatypes


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


gabor salai wrote :

with "copy/paste" [say some range], does excel use clipboard, or some
internal structure?
after "copy", is it possible to somehow access that buffer [before
"paste"], and to examine it, or even programaticaly select [or apply]
just a part of buffer.
it is something like "paste special" does, but i would like to have
full [free] user intervention.
it would be also intersting to programaticaly [freely] fill that
"copy/paste" buffer.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default clipboard

I have manipulated the clipboard using APIs and keepITcool is right - it
isn't easy to do much beyond the basics. I am not sure what you have in
mind, but here's an idea: create either a hidden sheet or at least a hidden
range somewhere. Do a Range.Paste operation into that range and then use
your code to examine or manipulate the results. Then copy back into the
clipboard if needed. In other words, you are creating your own "buffer" on
the sheet, temporarily. Still has some drawbacks (e.g. what would happen if
the clipboard contained a picture?) but it might let you do some processing
of what is in the clipboard before proceding with whatever it is you need to
do. Just a thought.

"keepITcool" wrote:

well...

Clpbrd.exe will tell you what's on the clipboard.
copy a cell and check it out.

Be sure to use the View dropdown to see all the datatypes
such a 'basic copy' puts in the clipboard.

Freely filling the clipboard cannot be easily done VBA,
you'll need to use API's for that and it will be very complex
if you go beyond the very basic (documented) datatypes


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


gabor salai wrote :

with "copy/paste" [say some range], does excel use clipboard, or some
internal structure?
after "copy", is it possible to somehow access that buffer [before
"paste"], and to examine it, or even programaticaly select [or apply]
just a part of buffer.
it is something like "paste special" does, but i would like to have
full [free] user intervention.
it would be also intersting to programaticaly [freely] fill that
"copy/paste" buffer.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default clipboard

[rearanged]

gabor salai wrote :

with "copy/paste" [say some range], does excel use clipboard, or some
internal structure?
after "copy", is it possible to somehow access that buffer [before
"paste"], and to examine it, or even programaticaly select [or apply]


"keepITcool" wrote in message
ft.com...
well...

Clpbrd.exe will tell you what's on the clipboard.
copy a cell and check it out.


thanks, i wanted to access clipboard [or whatever buffer excel employes]
from *within* excel macro, not from clipboard_viewer!

something like:

set myrange=getclipboard.range(1)
value1=myrange.cells(1,2).value

where cells from clipboarded region should count relatively to upper_left
corner of selection captured by "copy"





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default clipboard

Gabor,

as I said the clipboard is not exposed thru VBA, you'll need API's.

mentioning clpbrd.exe was to demonstrate that YES excel uses the global
clipboard in a multitude of formats.

it was a serious answer that you obviously interpreted the wrong way.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


gabor salai wrote :

[rearanged]

gabor salai wrote :

with "copy/paste" [say some range], does excel use clipboard, or
some internal structure?
after "copy", is it possible to somehow access that buffer [before
"paste"], and to examine it, or even programaticaly select [or
apply]


"keepITcool" wrote in message
ft.com...
well...

Clpbrd.exe will tell you what's on the clipboard.
copy a cell and check it out.


thanks, i wanted to access clipboard [or whatever buffer excel
employes] from within excel macro, not from clipboard_viewer!

something like:

set myrange=getclipboard.range(1)
value1=myrange.cells(1,2).value

where cells from clipboarded region should count relatively to
upper_left corner of selection captured by "copy"



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default clipboard

"keepITcool" wrote in message
ft.com...
Gabor,

as I said the clipboard is not exposed thru VBA, you'll need API's.

mentioning clpbrd.exe was to demonstrate that YES excel uses the global
clipboard in a multitude of formats.

it was a serious answer that you obviously interpreted the wrong way.



sorry, i just wanted to be sure that been understood well.
and sorry again for vba missing clipboard functionality.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


gabor salai wrote :

[rearanged]

gabor salai wrote :

with "copy/paste" [say some range], does excel use clipboard, or
some internal structure?
after "copy", is it possible to somehow access that buffer [before
"paste"], and to examine it, or even programaticaly select [or
apply]


"keepITcool" wrote in message
ft.com...
well...

Clpbrd.exe will tell you what's on the clipboard.
copy a cell and check it out.


thanks, i wanted to access clipboard [or whatever buffer excel
employes] from within excel macro, not from clipboard_viewer!

something like:

set myrange=getclipboard.range(1)
value1=myrange.cells(1,2).value

where cells from clipboarded region should count relatively to
upper_left corner of selection captured by "copy"



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default clipboard

a quick sample of complexity:
this will ONLY get you the size of any range data on the clipboard:

adapted from thread:
Row_count in clipboard oct8,2004

Option Explicit

Const CF_SYLK = 4
Const CF_DSPTEXT = &H81

Declare Function OpenClipboard Lib "user32" ( _
ByVal Hwnd As Long) As Long
Declare Function CloseClipboard Lib "user32" () As Long


Declare Function IsClipboardFormatAvailable Lib "user32" ( _
ByVal wFormat As Long) As Long
Declare Function GetClipboardData Lib "user32" ( _
ByVal wFormat As Long) As Long

Declare Function GlobalLock Lib "kernel32" ( _
ByVal hMem As Long) As Long
Declare Function GlobalUnlock Lib "kernel32" ( _
ByVal hMem As Long) As Long
Declare Function GlobalSize Lib "kernel32" ( _
ByVal hMem As Long) As Long
Declare Function lstrcpy Lib "kernel32" ( _
ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" ( _
ByVal lpString As String) As Long

Function CBRows()
CBRows = ClipBoard_RangeSize(0)
End Function
Function CBCols()
CBCols = ClipBoard_RangeSize(1)
End Function

Function ClipBoard_RangeSize()
'author: keepITcool Oct 9, 2004
'does NOT work for xl97

Dim lhCB&, lpCB&, lRet&, lSize&, sText$
Dim aTmp, sTmp$, nRow&, nCol&

If IsClipboardFormatAvailable(CF_SYLK) Then
If OpenClipboard(0&) < 0 Then
lhCB = GetClipboardData(CF_DSPTEXT)
If lhCB < 0 Then
lpCB = GlobalLock(lhCB)
If lpCB < 0 Then
lSize = GlobalSize(lpCB)
sText = Space$(lSize)
lRet = lstrcpy(sText, lpCB)
lRet = GlobalUnlock(lhCB)
sText = Left(sText, InStr(1, sText, Chr$(0), 0) - 1)
End If
End If
CloseClipboard
End If
If sText Like "* *#? x *#?" Then
aTmp = Split(sText, Space$(1))
nRow = Val(aTmp(UBound(aTmp) - 2))
nCol = Val(aTmp(UBound(aTmp)))
End If
End If
ClipBoard_RangeSize = Array(nRow, nCol)
End Function











--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


gabor salai wrote :

"keepITcool" wrote in message
ft.com...
Gabor,

as I said the clipboard is not exposed thru VBA, you'll need API's.

mentioning clpbrd.exe was to demonstrate that YES excel uses the
global clipboard in a multitude of formats.

it was a serious answer that you obviously interpreted the wrong
way.



sorry, i just wanted to be sure that been understood well.
and sorry again for vba missing clipboard functionality.



--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



gabor salai wrote :

[rearanged]

gabor salai wrote :

with "copy/paste" [say some range], does excel use clipboard,
or some internal structure?
after "copy", is it possible to somehow access that buffer
[before "paste"], and to examine it, or even programaticaly
select [or apply]

"keepITcool" wrote in message
ft.com...
well...

Clpbrd.exe will tell you what's on the clipboard.
copy a cell and check it out.

thanks, i wanted to access clipboard [or whatever buffer excel
employes] from within excel macro, not from clipboard_viewer!

something like:

set myrange=getclipboard.range(1)
value1=myrange.cells(1,2).value

where cells from clipboarded region should count relatively to
upper_left corner of selection captured by "copy"

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard traderduke Excel Discussion (Misc queries) 0 August 11th 09 04:50 PM
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 1 May 18th 09 06:56 AM
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
clipboard pop up Michelle Excel Programming 1 October 5th 04 07:29 PM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"