+ Reply to Thread
Results 1 to 10 of 10

Clipboard clear

  1. #1
    Reuel
    Guest

    Clipboard clear

    Is there any way to clear the clipboard in a macro run? I've been having
    strange programmatic freezes after a long series of cut/paste/select
    operations (see previous post by me) and I thought that it might help force a
    clear of the clipboard periodically.

    Also, can anyone suggest another resource for help when no one inthis forum
    has a suggestion for solving Excel programming problems?
    Thanks,


  2. #2
    RB Smissaert
    Guest

    Re: Clipboard clear

    Put at the top of the normal code module:
    Private Declare Function EmptyClipboard Lib "user32" () As Long

    Then where you want to clear the clipboard put:
    Call EmptyClipboard

    RBS


    "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    > Is there any way to clear the clipboard in a macro run? I've been having
    > strange programmatic freezes after a long series of cut/paste/select
    > operations (see previous post by me) and I thought that it might help
    > force a
    > clear of the clipboard periodically.
    >
    > Also, can anyone suggest another resource for help when no one inthis
    > forum
    > has a suggestion for solving Excel programming problems?
    > Thanks,
    >



  3. #3
    Reuel
    Guest

    Re: Clipboard clear

    Thanks for the code! Unfortunately, it didn't solve my problem (previous post
    by me, "Macro runs several times, then crashes...").

    Anyone know where I can get support for intractable Excel problems when no
    one in this forum has a suggestion?
    Thanks!

    "RB Smissaert" wrote:

    > Put at the top of the normal code module:
    > Private Declare Function EmptyClipboard Lib "user32" () As Long
    >
    > Then where you want to clear the clipboard put:
    > Call EmptyClipboard
    >
    > RBS
    >
    >
    > "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    > news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    > > Is there any way to clear the clipboard in a macro run? I've been having
    > > strange programmatic freezes after a long series of cut/paste/select
    > > operations (see previous post by me) and I thought that it might help
    > > force a
    > > clear of the clipboard periodically.
    > >
    > > Also, can anyone suggest another resource for help when no one inthis
    > > forum
    > > has a suggestion for solving Excel programming problems?
    > > Thanks,
    > >

    >
    >


  4. #4
    RB Smissaert
    Guest

    Re: Clipboard clear

    Sorry, that should be:

    Option Explicit
    Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
    Long
    Private Declare Function CloseClipboard Lib "user32" () As Long
    Private Declare Function EmptyClipboard Lib "user32" () As Long

    Sub ClearClipboard()
    OpenClipboard Application.hwnd
    EmptyClipboard
    CloseClipboard
    End Sub

    The clipboard has to be opened first and then closed after clearing it.

    RBS



    "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    > Is there any way to clear the clipboard in a macro run? I've been having
    > strange programmatic freezes after a long series of cut/paste/select
    > operations (see previous post by me) and I thought that it might help
    > force a
    > clear of the clipboard periodically.
    >
    > Also, can anyone suggest another resource for help when no one inthis
    > forum
    > has a suggestion for solving Excel programming problems?
    > Thanks,
    >



  5. #5
    Jai
    Guest

    Re: Clipboard clear

    Hi RB,

    Was browsing for just this. What does Lib "user 32" mean? are there other
    libraries? Could you tell me how to locate them and see what they can do for
    me?
    Thanks for your suggestion and thanks in advance for this input

    Jai

    "RB Smissaert" wrote:

    > Put at the top of the normal code module:
    > Private Declare Function EmptyClipboard Lib "user32" () As Long
    >
    > Then where you want to clear the clipboard put:
    > Call EmptyClipboard
    >
    > RBS
    >
    >
    > "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    > news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    > > Is there any way to clear the clipboard in a macro run? I've been having
    > > strange programmatic freezes after a long series of cut/paste/select
    > > operations (see previous post by me) and I thought that it might help
    > > force a
    > > clear of the clipboard periodically.
    > >
    > > Also, can anyone suggest another resource for help when no one inthis
    > > forum
    > > has a suggestion for solving Excel programming problems?
    > > Thanks,
    > >

    >
    >


  6. #6
    RB Smissaert
    Guest

    Re: Clipboard clear

    This is the Windows API, application programming interface.
    Many of the functions in the API can be used in Excel or VBA/VB in general
    via declare statements.
    Best to get one of the freeware programs that help you using this. One of
    them,
    the API guide can be downloaded from here:
    http://www.mentalis.org/index2.shtml

    RBS


    "Jai" <Jai@discussions.microsoft.com> wrote in message
    news:42769B64-727F-436D-B1E3-B84CDAB3473F@microsoft.com...
    > Hi RB,
    >
    > Was browsing for just this. What does Lib "user 32" mean? are there
    > other
    > libraries? Could you tell me how to locate them and see what they can do
    > for
    > me?
    > Thanks for your suggestion and thanks in advance for this input
    >
    > Jai
    >
    > "RB Smissaert" wrote:
    >
    >> Put at the top of the normal code module:
    >> Private Declare Function EmptyClipboard Lib "user32" () As Long
    >>
    >> Then where you want to clear the clipboard put:
    >> Call EmptyClipboard
    >>
    >> RBS
    >>
    >>
    >> "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    >> news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    >> > Is there any way to clear the clipboard in a macro run? I've been
    >> > having
    >> > strange programmatic freezes after a long series of cut/paste/select
    >> > operations (see previous post by me) and I thought that it might help
    >> > force a
    >> > clear of the clipboard periodically.
    >> >
    >> > Also, can anyone suggest another resource for help when no one inthis
    >> > forum
    >> > has a suggestion for solving Excel programming problems?
    >> > Thanks,
    >> >

    >>
    >>



  7. #7
    G-Force
    Guest

    Re: Clipboard clear

    When I compile the code below (in Access 2003) I get an error at this line :

    OpenClipboard Application.hwnd

    The error I get is "method or data member not found"

    What is causing this ????????


    "RB Smissaert" wrote:

    > Sorry, that should be:
    >
    > Option Explicit
    > Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
    > Long
    > Private Declare Function CloseClipboard Lib "user32" () As Long
    > Private Declare Function EmptyClipboard Lib "user32" () As Long
    >
    > Sub ClearClipboard()
    > OpenClipboard Application.hwnd
    > EmptyClipboard
    > CloseClipboard
    > End Sub
    >
    > The clipboard has to be opened first and then closed after clearing it.
    >
    > RBS
    >
    >
    >
    > "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    > news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    > > Is there any way to clear the clipboard in a macro run? I've been having
    > > strange programmatic freezes after a long series of cut/paste/select
    > > operations (see previous post by me) and I thought that it might help
    > > force a
    > > clear of the clipboard periodically.
    > >
    > > Also, can anyone suggest another resource for help when no one inthis
    > > forum
    > > has a suggestion for solving Excel programming problems?
    > > Thanks,
    > >

    >
    >


  8. #8
    G-Force
    Guest

    Re: Clipboard clear

    When I compile the code below (in Access 2003) I get an error at this line :

    OpenClipboard Application.hwnd

    The error I get is "method or data member not found"

    What is causing this ????????

    "RB Smissaert" wrote:

    > Sorry, that should be:
    >
    > Option Explicit
    > Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
    > Long
    > Private Declare Function CloseClipboard Lib "user32" () As Long
    > Private Declare Function EmptyClipboard Lib "user32" () As Long
    >
    > Sub ClearClipboard()
    > OpenClipboard Application.hwnd
    > EmptyClipboard
    > CloseClipboard
    > End Sub
    >
    > The clipboard has to be opened first and then closed after clearing it.
    >
    > RBS
    >
    >
    >
    > "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    > news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    > > Is there any way to clear the clipboard in a macro run? I've been having
    > > strange programmatic freezes after a long series of cut/paste/select
    > > operations (see previous post by me) and I thought that it might help
    > > force a
    > > clear of the clipboard periodically.
    > >
    > > Also, can anyone suggest another resource for help when no one inthis
    > > forum
    > > has a suggestion for solving Excel programming problems?
    > > Thanks,
    > >

    >
    >


  9. #9
    Chip Pearson
    Guest

    Re: Clipboard clear

    The Access object model does not expose the HWnd property of the
    Application.


    "G-Force" <GForce@discussions.microsoft.com> wrote in message
    news:1C67973F-B16A-442C-AAE2-5BBC310B6062@microsoft.com...
    > When I compile the code below (in Access 2003) I get an error
    > at this line :
    >
    > OpenClipboard Application.hwnd
    >
    > The error I get is "method or data member not found"
    >
    > What is causing this ????????
    >
    > "RB Smissaert" wrote:
    >
    >> Sorry, that should be:
    >>
    >> Option Explicit
    >> Private Declare Function OpenClipboard Lib "user32" (ByVal
    >> hwnd As Long) As
    >> Long
    >> Private Declare Function CloseClipboard Lib "user32" () As
    >> Long
    >> Private Declare Function EmptyClipboard Lib "user32" () As
    >> Long
    >>
    >> Sub ClearClipboard()
    >> OpenClipboard Application.hwnd
    >> EmptyClipboard
    >> CloseClipboard
    >> End Sub
    >>
    >> The clipboard has to be opened first and then closed after
    >> clearing it.
    >>
    >> RBS
    >>
    >>
    >>
    >> "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    >> news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    >> > Is there any way to clear the clipboard in a macro run? I've
    >> > been having
    >> > strange programmatic freezes after a long series of
    >> > cut/paste/select
    >> > operations (see previous post by me) and I thought that it
    >> > might help
    >> > force a
    >> > clear of the clipboard periodically.
    >> >
    >> > Also, can anyone suggest another resource for help when no
    >> > one inthis
    >> > forum
    >> > has a suggestion for solving Excel programming problems?
    >> > Thanks,
    >> >

    >>
    >>




  10. #10
    Zack Barresse
    Guest

    Re: Clipboard clear

    Try this ...


    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


    HTH

    --
    Regards,
    Zack Barresse, aka firefytr, (GT = TFS FF Zack)



    "G-Force" <GForce@discussions.microsoft.com> wrote in message
    news:828C4187-BB0B-461F-A054-772F4D2F1C86@microsoft.com...
    > When I compile the code below (in Access 2003) I get an error at this line
    > :
    >
    > OpenClipboard Application.hwnd
    >
    > The error I get is "method or data member not found"
    >
    > What is causing this ????????
    >
    >
    > "RB Smissaert" wrote:
    >
    >> Sorry, that should be:
    >>
    >> Option Explicit
    >> Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long)
    >> As
    >> Long
    >> Private Declare Function CloseClipboard Lib "user32" () As Long
    >> Private Declare Function EmptyClipboard Lib "user32" () As Long
    >>
    >> Sub ClearClipboard()
    >> OpenClipboard Application.hwnd
    >> EmptyClipboard
    >> CloseClipboard
    >> End Sub
    >>
    >> The clipboard has to be opened first and then closed after clearing it.
    >>
    >> RBS
    >>
    >>
    >>
    >> "Reuel" <Reuel@discussions.microsoft.com> wrote in message
    >> news:C6DA21DE-9995-4F27-B576-D52A15FF3BF4@microsoft.com...
    >> > Is there any way to clear the clipboard in a macro run? I've been
    >> > having
    >> > strange programmatic freezes after a long series of cut/paste/select
    >> > operations (see previous post by me) and I thought that it might help
    >> > force a
    >> > clear of the clipboard periodically.
    >> >
    >> > Also, can anyone suggest another resource for help when no one inthis
    >> > forum
    >> > has a suggestion for solving Excel programming problems?
    >> > Thanks,
    >> >

    >>
    >>




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1