Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Toggle Close Button    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Clear Entire Clipboard
Maggie M 
     
13 months ago
Thanks for all your hard work in making these videos. They're always great & I ALWAYS learn something. I might be out in left field here, but is there an API call to clear the entire clipboard? I put together a password db & would like to clear the copied password(s) when the db closes. Thoughts or suggestions ...
Alex Hedley  @Reply  
           
13 months ago
Untested:

Application.CutCopyMode = False

or

Dim oData   As New DataObject 'object to use the clipboard
oData.SetText text:=Empty 'Clear
oData.PutInClipboard 'take in the clipboard to empty it


or

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 Sub ClearClipboard()
    OpenClipboard (0&)
    EmptyClipboard
    CloseClipboard
End Sub


Source: https://stackoverflow.com/questions/32736915/how-to-clear-office-clipboard-with-vba
Maggie M OP  @Reply  
     
13 months ago
Thanks for your quick response, Alex. i actually did get this from stackoverflow.com, but it doesn't even remove the first item on the clipboard, let alone clear all of it. i also tried a snippet of code from Daniel Pineault witch used the 2nd answer above where he uses Set oData = CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}"), but all that does is remove the first item. Any other suggestions?

VBA to clear clipboard
https://answers.microsoft.com/en-us/msoffice/forum/all/vba-to-clear-clipboard/445a196f-6feb-4336-9600-5583842e3209
Alex Hedley  @Reply  
           
13 months ago
Clearing the ClipBoard
https://www.devhut.net/clearing-the-clipboard/

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd.exe /c echo off | clip", 0, True

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Toggle Close Button.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 4:25:37 PM. PLT: 0s