Consulting

Results 1 to 7 of 7

Thread: Window 8 PutInClipboard error

  1. #1
    VBAX Regular
    Joined
    Feb 2007
    Posts
    35
    Location

    Window 8 PutInClipboard error

    Hi all,

    Been looking for a resolution to an error I get with the PutInClipboard code below. Works in everything but win8 with office 2010. I get a "?" icon instead of the text. Any help would be greatly appreciated.

    Dim objData As New DataObject,  strCopy2 As String
        
        strCopy2 = "Test"
        With objData
            .SetText strCopy2
            .PutInClipboard
        End With

  2. #2
    VBAX Regular
    Joined
    Feb 2007
    Posts
    35
    Location
    MS is aware of the problem: http://social.msdn.microsoft.com/For...s-in-clipboard, no concrete answer so far

  3. #3
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    What do you get using:

    Sub M_snb()
        With New DataObject
            .SetText "Test_snb"
            .PutInClipboard
            MsgBox .GetText
            MsgBox .GetFormat(1)
        End With
    End Sub

  4. #4
    VBAX Regular
    Joined
    Feb 2007
    Posts
    35
    Location
    Quote Originally Posted by snb View Post
    What do you get using:

    Sub M_snb()
        With New DataObject
            .SetText "Test_snb"
            .PutInClipboard
            MsgBox .GetText
            MsgBox .GetFormat(1)
        End With
    End Sub

    Same error for pasting but msgbox isn't an issue. I don't use a dataobject for that

  5. #5
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    hi.

    both codes worked for me with office 2010 on win8 machine.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  6. #6
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    I don't have win8 to test. The link said that 2/5 times there was a problem with that control in win8. Problems like this break some controls. 64bit vs. 32bit is the issue.

    I would put this links code into a Module and use them instead. You may still run into the 32 vs. 64 bit issue with API commands. Some of these may need an equivalent 64 bit code.

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

  7. #7
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    my test:
    win8 is 64-bit and office 2010 is 32-bit
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

Posting Permissions

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