+ Reply to Thread
Results 1 to 8 of 8

VBA code to copy user form textbox content to clipboard

  1. #1
    Registered User
    Join Date
    09-12-2015
    Location
    Norway
    MS-Off Ver
    Excel for Mac 2011
    Posts
    8

    VBA code to copy user form textbox content to clipboard

    All,

    I was using windows for a while and also created a macro to automate my task. Recently I am moved to Mac os and tried to run the same macro in excel for mac 2011, but its not working. I am just trying to copy the content available in textbox3 of the userform to the clipboard, so that i can directly paste that code to my wordpress site.

    Found something wrong with this piece of code.

    code

    Private Sub CommandButton1_Click()
    Dim w As New DataObject
    w.SetText TextBox3.Text
    w.PutInClipboard
    End Sub

    /code

    I heard that data objects are not supported in mac excel. Hence someone pls help me to fix this.

    Thanks.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: VBA code to copy user form textbox content to clipboard

    Im not sure about Mac workings....but
    you could 'cheat' and write the data to a text file 'clipboard'.
    then open it when you need it back.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-12-2015
    Location
    Norway
    MS-Off Ver
    Excel for Mac 2011
    Posts
    8

    Re: VBA code to copy user form textbox content to clipboard

    Hi Sir,

    First of all thanks a lot for your response. Tried running the code, but encountering the following error;

    "Constants, fixed-length strings, arrays, user-defined types and Declare statements not allowed as Public members of object modules"

    Hence please check and do the needful.

    Thanks.

  4. #4
    Registered User
    Join Date
    09-12-2015
    Location
    Norway
    MS-Off Ver
    Excel for Mac 2011
    Posts
    8

    Re: VBA code to copy user form textbox content to clipboard

    All,

    Anyone would you please respond.

    Thanks

  5. #5
    Registered User
    Join Date
    09-12-2015
    Location
    Norway
    MS-Off Ver
    Excel for Mac 2011
    Posts
    8

    Re: VBA code to copy user form textbox content to clipboard

    Anyone pls help

  6. #6
    Registered User
    Join Date
    09-12-2015
    Location
    Norway
    MS-Off Ver
    Excel for Mac 2011
    Posts
    8

    Re: VBA code to copy user form textbox content to clipboard

    Kindly help

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: VBA code to copy user form textbox content to clipboard

    Do no bump your thread until 24 hours without a response.
    Ben Van Johnson

  8. #8
    Registered User
    Join Date
    09-12-2015
    Location
    Norway
    MS-Off Ver
    Excel for Mac 2011
    Posts
    8

    Re: VBA code to copy user form textbox content to clipboard

    All,

    Could you please update on the above query.

    Thaks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. COPY content to clipboard based on cell criteria
    By completelyhis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2014, 04:12 AM
  2. [SOLVED] TextBox user input to change text in content control with VBA?
    By EnigmaMatter in forum Word Formatting & General
    Replies: 2
    Last Post: 09-06-2014, 06:56 PM
  3. copy only visible text boxes to clipboard from user form
    By brewsi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2014, 09:36 PM
  4. Copy cell content to clipboard to paste into a pdf
    By kevinm3u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2014, 03:30 PM
  5. vba excel user form restrict input on user textbox
    By samz93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 04:38 PM
  6. [SOLVED] Help with Userform textbox value, vlookup, copy to clipboard
    By etuckram in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 07-04-2012, 09:25 PM
  7. Copy content of cell to clipboard
    By amitmodi_mrt in forum Excel General
    Replies: 3
    Last Post: 09-08-2009, 11:26 AM

Tags for this Thread

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