Clearing Clipboard in Excel 2013 VBA

melson titular

New Member
Joined
Oct 3, 2013
Messages
43
Hello guys.,

i have found this code and tried it out.,
upon checking., it seems it is applicable only for 2004 and below excel versions.
is there other way to clear the clipboard in excel 2013?

Option Explicit
Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long
Public Declare Function CloseClipboard Lib "user32" () As Long
Public Function ClearClipboard()
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
End Function
Sub Test()
Call ClearClipboard
End Sub

regards, melson
 
Hi mark,

Good day.,
i tried the code and i did not get an error but my clipboard is still present.

i am running in windows 7, excel 2013.,
maybe there is different code for this version.

regards, melson
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
By chance, are you referring to the Office Clipboard, rather than the Windows Clipboard?
 
Upvote 0
By chance, are you referring to the Office Clipboard, rather than the Windows Clipboard?

hi GTO.,

i'm not aware that there are 2 clipboards and i am not sure on what clipboard i am using.,
what I am sure of is that my clipboard is located inside excel., under HOME tab then clipboard.

regards, melson
 
Upvote 0
There are "two clipboards", or at least a secondary MS-Office implementation of the clipboard, wherein you can have multiple "things" stored. When you use the clipboard that you have been referring to, is there a Task Pane? That is, a secondary window, that has (akin to) '1of n' - Clipboard' in the TitleBar?

Mark
 
Upvote 0
There are "two clipboards", or at least a secondary MS-Office implementation of the clipboard, wherein you can have multiple "things" stored. When you use the clipboard that you have been referring to, is there a Task Pane? That is, a secondary window, that has (akin to) '1of n' - Clipboard' in the TitleBar?

Mark

sorry for late reply, i am in 4 days camping in the mountain.

i don's see task pane in my clipboard.,
for secondary window, is this the one with the "x" mark inside a red box at the upper right corner?, if yes, then i don't see the the secondary window.

the clipboard is resting in the left side of my excel 2013., that is when i click HOME tab then clipboards.
 
Upvote 0
...i don's see task pane in my clipboard.,

I am sorry, but I do not understand what "task pane in my clipboard" means.

...for secondary window, is this the one with the "x" mark inside a red box at the upper right corner?, if yes, then i don't see the the secondary window.

Again, I am not following I am afraid.

...the clipboard is resting in the left side of my excel 2013., that is when i click HOME tab then clipboards.

Ah Ha! I may be wrong, but I bet you are referring to the task pane. I do not have access to 2013 (Excel), and unfortunately, I have no way (that I know of) to show a screenshot.

If you close this "clipboard" and copy just one cell, or better yet, copy some text from a text file or similar - then run the code and see if you can still paste anything.

sorry for late reply, i am in 4 days camping in the mountain...

Good for you! It has been way too long since I have had time to camp or camp and hunt. What a great thing to get away and at least ignore the world and city life for a few days. I hope you are enjoying yourself immensely :)

Mark
 
Upvote 0
Hi mark,

yes., i went back to old school way of living., time is very slow up there in the mountains., =)

i test it again and my clipboard is still present.

i am just wondering., does the clipboard overflows?, i mean if in case i copy paste a hundred or thousand times., will my memory hung up?

what i am trying to do is that i will copy the cells of the protected worksheet from workbook A., then close workbook A (which leads me to a question of "want to save the workbook A.xlsx? if you click don't save, a recent copy of this file will be temporarily availbale). i will choose obviously "don't save" so i can still use content of what i have copied then paste it to my original working file., After pasting., i am going to do some copy then paste to the raw data., deleting unnecessary columns and come up with a furnished data (i am going to name this process as Process A). This will be the complete cycle of the program and it will be repeated until it reaches workbook Z.
i have successfully completed the program for this one.,

the problem now is Process A., when i copy a cell then paste it to another cells., for unexplained reasons.,
some content of the cells are being copied but some are not. i don't know what is the root cause for this., i was suspecting that the clipboard is the main reason.

thanks for reading my message., hope i explained it well and you did not fell asleep.. hehe.

regards, melson
 
Last edited:
Upvote 0
(which leads me to a question of "want to save the workbook A.xlsx? if you click don't save, a recent copy of this file will be temporarily availbale).

sorry., let me rephrase this question., see below

"There is a large amount of information on the Clipboard. Do you want to be able to paste this information into another program later?"

- to save it on the Clipboard so that you can paste it later, Click Yes.
- to delete it from the clipboard and free memory., click No.

 
Upvote 0

Forum statistics

Threads
1,215,829
Messages
6,127,129
Members
449,361
Latest member
VBquery757

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top