+ Reply to Thread
Results 1 to 6 of 6

Clipboard Clear API error

  1. #1
    G-Force
    Guest

    Clipboard Clear API error

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

    'OpenClipboard Application.hwnd' (hwnd is highlighted)

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

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


    "RB Smissaert" wrote:

    Click to show or hide original message or reply text.


    Click to show or hide original message or reply text.


    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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
    Greg Wilson
    Guest

    RE: Clipboard Clear API error

    This works for me in Excel. I never use Access:
    OpenClipboard (0&)

    I believe Application.Hwnd is only recognized in VB as opposed to VBA.

    Regards,
    Greg


    "G-Force" wrote:

    > When I compile the code below (in Access 2003) I get an error at this line :
    >
    > 'OpenClipboard Application.hwnd' (hwnd is highlighted)
    >
    > The error I get is "method or data member not found"
    >
    > What is causing this ????????
    >
    >
    > "RB Smissaert" wrote:
    >
    > Click to show or hide original message or reply text.
    >
    >
    > Click to show or hide original message or reply text.
    >
    >
    > > 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" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > 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
    Chip Pearson
    Guest

    Re: Clipboard Clear API error

    The Access object model does not expose the HWnd property of the
    Application object. You can pass 0 to OpenClipboard instead of
    the HWnd.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "G-Force" <[email protected]> wrote in message
    news:[email protected]...
    > When I compile the code below (in Access 2003) I get an error
    > at this line :
    >
    > 'OpenClipboard Application.hwnd' (hwnd is highlighted)
    >
    > The error I get is "method or data member not found"
    >
    > What is causing this ????????
    >
    >
    > "RB Smissaert" wrote:
    >
    > Click to show or hide original message or reply text.
    >
    >
    > Click to show or hide original message or reply text.
    >
    >
    >> 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > 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
    G-Force
    Guest

    RE: Clipboard Clear API error

    Thanks Greg. I'll try this.

    "Greg Wilson" wrote:

    > This works for me in Excel. I never use Access:
    > OpenClipboard (0&)
    >
    > I believe Application.Hwnd is only recognized in VB as opposed to VBA.
    >
    > Regards,
    > Greg
    >
    >
    > "G-Force" wrote:
    >
    > > When I compile the code below (in Access 2003) I get an error at this line :
    > >
    > > 'OpenClipboard Application.hwnd' (hwnd is highlighted)
    > >
    > > The error I get is "method or data member not found"
    > >
    > > What is causing this ????????
    > >
    > >
    > > "RB Smissaert" wrote:
    > >
    > > Click to show or hide original message or reply text.
    > >
    > >
    > > Click to show or hide original message or reply text.
    > >
    > >
    > > > 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" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > 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
    G-Force
    Guest

    Re: Clipboard Clear API error

    Thanks Chip - I'll try passing 0 with a % sign. gr

    "Chip Pearson" wrote:

    > The Access object model does not expose the HWnd property of the
    > Application object. You can pass 0 to OpenClipboard instead of
    > the HWnd.
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "G-Force" <[email protected]> wrote in message
    > news:[email protected]...
    > > When I compile the code below (in Access 2003) I get an error
    > > at this line :
    > >
    > > 'OpenClipboard Application.hwnd' (hwnd is highlighted)
    > >
    > > The error I get is "method or data member not found"
    > >
    > > What is causing this ????????
    > >
    > >
    > > "RB Smissaert" wrote:
    > >
    > > Click to show or hide original message or reply text.
    > >
    > >
    > > Click to show or hide original message or reply text.
    > >
    > >
    > >> 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > 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
    G-Force
    Guest

    Re: Clipboard Clear API error

    Actually i'll use 0 with a Ampersand - Thanks. GR

    "Chip Pearson" wrote:

    > The Access object model does not expose the HWnd property of the
    > Application object. You can pass 0 to OpenClipboard instead of
    > the HWnd.
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "G-Force" <[email protected]> wrote in message
    > news:[email protected]...
    > > When I compile the code below (in Access 2003) I get an error
    > > at this line :
    > >
    > > 'OpenClipboard Application.hwnd' (hwnd is highlighted)
    > >
    > > The error I get is "method or data member not found"
    > >
    > > What is causing this ????????
    > >
    > >
    > > "RB Smissaert" wrote:
    > >
    > > Click to show or hide original message or reply text.
    > >
    > >
    > > Click to show or hide original message or reply text.
    > >
    > >
    > >> 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > 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