+ Reply to Thread
Results 1 to 11 of 11

Preserve contents of Clipboard when altering display options

  1. #1
    Peter Rooney
    Guest

    Preserve contents of Clipboard when altering display options

    Good morning, all,

    I notice that if I copy something to the clipboard, then alter any of the
    application or window display settings, the contents of the Clipboard are
    lost.

    This happens in "Normal" Excel too, as well as in VBA - can anyone suggest a
    way of somehow preserving the contents of the clipboard?
    I'm using Excel 2003.

    Thanks in advance

    Pete

  2. #2
    Tom Ogilvy
    Guest

    Re: Preserve contents of Clipboard when altering display options

    don't copy to the clip board until the next action is to paste. Make your
    changes before copying.



    --
    Regards,
    Tom Ogilvy

    "Peter Rooney" <[email protected]> wrote in message
    news:[email protected]...
    > Good morning, all,
    >
    > I notice that if I copy something to the clipboard, then alter any of the
    > application or window display settings, the contents of the Clipboard are
    > lost.
    >
    > This happens in "Normal" Excel too, as well as in VBA - can anyone suggest

    a
    > way of somehow preserving the contents of the clipboard?
    > I'm using Excel 2003.
    >
    > Thanks in advance
    >
    > Pete




  3. #3
    RB Smissaert
    Guest

    Re: Preserve contents of Clipboard when altering display options

    If it is in VBA you could store the clipboard in a variable and restore from
    that after your code.

    RBS

    "Peter Rooney" <[email protected]> wrote in message
    news:[email protected]...
    > Good morning, all,
    >
    > I notice that if I copy something to the clipboard, then alter any of the
    > application or window display settings, the contents of the Clipboard are
    > lost.
    >
    > This happens in "Normal" Excel too, as well as in VBA - can anyone suggest
    > a
    > way of somehow preserving the contents of the clipboard?
    > I'm using Excel 2003.
    >
    > Thanks in advance
    >
    > Pete



  4. #4
    Peter Rooney
    Guest

    Re: Preserve contents of Clipboard when altering display options

    Tom,

    You helped me out with this one first time round - only problem is, in my
    latest app, the problem isn't occurring any more, but the code is basicslly
    the same!

    I'll have to rework it in the manner you suggest.

    Thanks

    Pete



    "Tom Ogilvy" wrote:

    > don't copy to the clip board until the next action is to paste. Make your
    > changes before copying.
    >
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Peter Rooney" <[email protected]> wrote in message
    > news:[email protected]...
    > > Good morning, all,
    > >
    > > I notice that if I copy something to the clipboard, then alter any of the
    > > application or window display settings, the contents of the Clipboard are
    > > lost.
    > >
    > > This happens in "Normal" Excel too, as well as in VBA - can anyone suggest

    > a
    > > way of somehow preserving the contents of the clipboard?
    > > I'm using Excel 2003.
    > >
    > > Thanks in advance
    > >
    > > Pete

    >
    >
    >


  5. #5
    Peter Rooney
    Guest

    Re: Preserve contents of Clipboard when altering display options

    That would be ideal, if you happened to know how I reference the clipboard
    contents in VBQ!

    Thanks!

    Pete



    "RB Smissaert" wrote:

    > If it is in VBA you could store the clipboard in a variable and restore from
    > that after your code.
    >
    > RBS
    >
    > "Peter Rooney" <[email protected]> wrote in message
    > news:[email protected]...
    > > Good morning, all,
    > >
    > > I notice that if I copy something to the clipboard, then alter any of the
    > > application or window display settings, the contents of the Clipboard are
    > > lost.
    > >
    > > This happens in "Normal" Excel too, as well as in VBA - can anyone suggest
    > > a
    > > way of somehow preserving the contents of the clipboard?
    > > I'm using Excel 2003.
    > >
    > > Thanks in advance
    > >
    > > Pete

    >
    >


  6. #6

    Re: Preserve contents of Clipboard when altering display options

    It is quite easy with the Windows API. Do a search on Google for
    something
    like setclipboard or getclipboard and Excel and you will have the code
    in no time.
    If you have VB6 or if you know somebody who has you could make a very
    simple
    ActiveX dll that does the same. It is easy in VB6 as that has a
    Clipboard object.

    RBS


    Peter Rooney wrote:
    > That would be ideal, if you happened to know how I reference the clipboard
    > contents in VBQ!
    >
    > Thanks!
    >
    > Pete
    >
    >
    >
    > "RB Smissaert" wrote:
    >
    > > If it is in VBA you could store the clipboard in a variable and restore from
    > > that after your code.
    > >
    > > RBS
    > >
    > > "Peter Rooney" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Good morning, all,
    > > >
    > > > I notice that if I copy something to the clipboard, then alter any of the
    > > > application or window display settings, the contents of the Clipboard are
    > > > lost.
    > > >
    > > > This happens in "Normal" Excel too, as well as in VBA - can anyone suggest
    > > > a
    > > > way of somehow preserving the contents of the clipboard?
    > > > I'm using Excel 2003.
    > > >
    > > > Thanks in advance
    > > >
    > > > Pete

    > >
    > >



  7. #7

    Re: Preserve contents of Clipboard when altering display options

    Here a URL that shows all the needed code:

    http://www.mvps.org/access/api/api0049.htm

    RBS


  8. #8
    RB Smissaert
    Guest

    Re: Preserve contents of Clipboard when altering display options

    If using the API is too much trouble then you could use the attached VB6
    ActiveX dll.
    Just set a reference to it in the VBE under Tools, References and run
    Regsvr32 and use it as in this example:

    Sub test()

    'VB6 ActiveX dll with the only the following code in a class module:

    'Public Sub SetClipboardString(strString As String)
    'Clipboard.Clear
    'Clipboard.SetText strString
    'End Sub

    'Public Function GetClipboardString() As String
    'GetClipboardString = Clipboard.GetText
    'End Function

    'Public Sub ClearClipboard()
    'Clipboard.Clear
    'End Sub

    Dim strString

    SetClipboardString "test"
    strString = GetClipboardString

    MsgBox strString

    ClearClipboard

    MsgBox GetClipboardString

    End Sub


    RBS


    "Peter Rooney" <[email protected]> wrote in message
    news:[email protected]...
    > That would be ideal, if you happened to know how I reference the clipboard
    > contents in VBQ!
    >
    > Thanks!
    >
    > Pete
    >
    >
    >
    > "RB Smissaert" wrote:
    >
    >> If it is in VBA you could store the clipboard in a variable and restore
    >> from
    >> that after your code.
    >>
    >> RBS
    >>
    >> "Peter Rooney" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Good morning, all,
    >> >
    >> > I notice that if I copy something to the clipboard, then alter any of
    >> > the
    >> > application or window display settings, the contents of the Clipboard
    >> > are
    >> > lost.
    >> >
    >> > This happens in "Normal" Excel too, as well as in VBA - can anyone
    >> > suggest
    >> > a
    >> > way of somehow preserving the contents of the clipboard?
    >> > I'm using Excel 2003.
    >> >
    >> > Thanks in advance
    >> >
    >> > Pete

    >>
    >>



  9. #9
    Peter Rooney
    Guest

    Re: Preserve contents of Clipboard when altering display options

    RB,
    I'll give this a go, but as I've never done anything in VB6, it may take me
    some time. Also, the system on which I want to run the Clipboard preservation
    will be used by multiple users, so there may be a licensing issue for me.

    Thank you for your help! :-)

    Pete



    "RB Smissaert" wrote:

    > If using the API is too much trouble then you could use the attached VB6
    > ActiveX dll.
    > Just set a reference to it in the VBE under Tools, References and run
    > Regsvr32 and use it as in this example:
    >
    > Sub test()
    >
    > 'VB6 ActiveX dll with the only the following code in a class module:
    >
    > 'Public Sub SetClipboardString(strString As String)
    > 'Clipboard.Clear
    > 'Clipboard.SetText strString
    > 'End Sub
    >
    > 'Public Function GetClipboardString() As String
    > 'GetClipboardString = Clipboard.GetText
    > 'End Function
    >
    > 'Public Sub ClearClipboard()
    > 'Clipboard.Clear
    > 'End Sub
    >
    > Dim strString
    >
    > SetClipboardString "test"
    > strString = GetClipboardString
    >
    > MsgBox strString
    >
    > ClearClipboard
    >
    > MsgBox GetClipboardString
    >
    > End Sub
    >
    >
    > RBS
    >
    >
    > "Peter Rooney" <[email protected]> wrote in message
    > news:[email protected]...
    > > That would be ideal, if you happened to know how I reference the clipboard
    > > contents in VBQ!
    > >
    > > Thanks!
    > >
    > > Pete
    > >
    > >
    > >
    > > "RB Smissaert" wrote:
    > >
    > >> If it is in VBA you could store the clipboard in a variable and restore
    > >> from
    > >> that after your code.
    > >>
    > >> RBS
    > >>
    > >> "Peter Rooney" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Good morning, all,
    > >> >
    > >> > I notice that if I copy something to the clipboard, then alter any of
    > >> > the
    > >> > application or window display settings, the contents of the Clipboard
    > >> > are
    > >> > lost.
    > >> >
    > >> > This happens in "Normal" Excel too, as well as in VBA - can anyone
    > >> > suggest
    > >> > a
    > >> > way of somehow preserving the contents of the clipboard?
    > >> > I'm using Excel 2003.
    > >> >
    > >> > Thanks in advance
    > >> >
    > >> > Pete
    > >>
    > >>

    >


  10. #10
    RB Smissaert
    Guest

    Re: Preserve contents of Clipboard when altering display options

    > as I've never done anything in VB6

    You won't need any experience with VB6 for this.
    It is as simple as ABC as in the example Sub.

    RBS

    "Peter Rooney" <[email protected]> wrote in message
    news:[email protected]...
    > RB,
    > I'll give this a go, but as I've never done anything in VB6, it may take
    > me
    > some time. Also, the system on which I want to run the Clipboard
    > preservation
    > will be used by multiple users, so there may be a licensing issue for me.
    >
    > Thank you for your help! :-)
    >
    > Pete
    >
    >
    >
    > "RB Smissaert" wrote:
    >
    >> If using the API is too much trouble then you could use the attached VB6
    >> ActiveX dll.
    >> Just set a reference to it in the VBE under Tools, References and run
    >> Regsvr32 and use it as in this example:
    >>
    >> Sub test()
    >>
    >> 'VB6 ActiveX dll with the only the following code in a class module:
    >>
    >> 'Public Sub SetClipboardString(strString As String)
    >> 'Clipboard.Clear
    >> 'Clipboard.SetText strString
    >> 'End Sub
    >>
    >> 'Public Function GetClipboardString() As String
    >> 'GetClipboardString = Clipboard.GetText
    >> 'End Function
    >>
    >> 'Public Sub ClearClipboard()
    >> 'Clipboard.Clear
    >> 'End Sub
    >>
    >> Dim strString
    >>
    >> SetClipboardString "test"
    >> strString = GetClipboardString
    >>
    >> MsgBox strString
    >>
    >> ClearClipboard
    >>
    >> MsgBox GetClipboardString
    >>
    >> End Sub
    >>
    >>
    >> RBS
    >>
    >>
    >> "Peter Rooney" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > That would be ideal, if you happened to know how I reference the
    >> > clipboard
    >> > contents in VBQ!
    >> >
    >> > Thanks!
    >> >
    >> > Pete
    >> >
    >> >
    >> >
    >> > "RB Smissaert" wrote:
    >> >
    >> >> If it is in VBA you could store the clipboard in a variable and
    >> >> restore
    >> >> from
    >> >> that after your code.
    >> >>
    >> >> RBS
    >> >>
    >> >> "Peter Rooney" <[email protected]> wrote in
    >> >> message
    >> >> news:[email protected]...
    >> >> > Good morning, all,
    >> >> >
    >> >> > I notice that if I copy something to the clipboard, then alter any
    >> >> > of
    >> >> > the
    >> >> > application or window display settings, the contents of the
    >> >> > Clipboard
    >> >> > are
    >> >> > lost.
    >> >> >
    >> >> > This happens in "Normal" Excel too, as well as in VBA - can anyone
    >> >> > suggest
    >> >> > a
    >> >> > way of somehow preserving the contents of the clipboard?
    >> >> > I'm using Excel 2003.
    >> >> >
    >> >> > Thanks in advance
    >> >> >
    >> >> > Pete
    >> >>
    >> >>

    >>



  11. #11
    Peter Rooney
    Guest

    Re: Preserve contents of Clipboard when altering display options

    RBS,

    I cheated. I found out that although the Paste & Paste Special commands are
    greyed out in Excel, once you've altered any of the workbook display options,
    whatever you coied to the Clipboard was still available in Office Clipboard.
    So, my users can use that to paste back in.
    Not the technical way, I grant you, but at least it will work for everyone.
    Thank heavens for standard builds!
    Thanks for all your help and interest though - I'll give your idea a try
    when i don't have as tight a deadline to work to..! :-)

    Regards

    Pete



    "RB Smissaert" wrote:

    > > as I've never done anything in VB6

    >
    > You won't need any experience with VB6 for this.
    > It is as simple as ABC as in the example Sub.
    >
    > RBS
    >
    > "Peter Rooney" <[email protected]> wrote in message
    > news:[email protected]...
    > > RB,
    > > I'll give this a go, but as I've never done anything in VB6, it may take
    > > me
    > > some time. Also, the system on which I want to run the Clipboard
    > > preservation
    > > will be used by multiple users, so there may be a licensing issue for me.
    > >
    > > Thank you for your help! :-)
    > >
    > > Pete
    > >
    > >
    > >
    > > "RB Smissaert" wrote:
    > >
    > >> If using the API is too much trouble then you could use the attached VB6
    > >> ActiveX dll.
    > >> Just set a reference to it in the VBE under Tools, References and run
    > >> Regsvr32 and use it as in this example:
    > >>
    > >> Sub test()
    > >>
    > >> 'VB6 ActiveX dll with the only the following code in a class module:
    > >>
    > >> 'Public Sub SetClipboardString(strString As String)
    > >> 'Clipboard.Clear
    > >> 'Clipboard.SetText strString
    > >> 'End Sub
    > >>
    > >> 'Public Function GetClipboardString() As String
    > >> 'GetClipboardString = Clipboard.GetText
    > >> 'End Function
    > >>
    > >> 'Public Sub ClearClipboard()
    > >> 'Clipboard.Clear
    > >> 'End Sub
    > >>
    > >> Dim strString
    > >>
    > >> SetClipboardString "test"
    > >> strString = GetClipboardString
    > >>
    > >> MsgBox strString
    > >>
    > >> ClearClipboard
    > >>
    > >> MsgBox GetClipboardString
    > >>
    > >> End Sub
    > >>
    > >>
    > >> RBS
    > >>
    > >>
    > >> "Peter Rooney" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > That would be ideal, if you happened to know how I reference the
    > >> > clipboard
    > >> > contents in VBQ!
    > >> >
    > >> > Thanks!
    > >> >
    > >> > Pete
    > >> >
    > >> >
    > >> >
    > >> > "RB Smissaert" wrote:
    > >> >
    > >> >> If it is in VBA you could store the clipboard in a variable and
    > >> >> restore
    > >> >> from
    > >> >> that after your code.
    > >> >>
    > >> >> RBS
    > >> >>
    > >> >> "Peter Rooney" <[email protected]> wrote in
    > >> >> message
    > >> >> news:[email protected]...
    > >> >> > Good morning, all,
    > >> >> >
    > >> >> > I notice that if I copy something to the clipboard, then alter any
    > >> >> > of
    > >> >> > the
    > >> >> > application or window display settings, the contents of the
    > >> >> > Clipboard
    > >> >> > are
    > >> >> > lost.
    > >> >> >
    > >> >> > This happens in "Normal" Excel too, as well as in VBA - can anyone
    > >> >> > suggest
    > >> >> > a
    > >> >> > way of somehow preserving the contents of the clipboard?
    > >> >> > I'm using Excel 2003.
    > >> >> >
    > >> >> > Thanks in advance
    > >> >> >
    > >> >> > Pete
    > >> >>
    > >> >>
    > >>

    >
    >


+ 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