+ Reply to Thread
Results 1 to 8 of 8

Textbox greater than 255 characters

  1. #1
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Textbox greater than 255 characters

    Hi all

    Not sure if this is a simple question or not - is it possible to pass the contents of a userform textbox (which exceeds 255 characters ) to a worksheet cell? It seems to truncate when I try to do so.

    Please Login or Register  to view this content.
    I even tried the following, with no success:

    Please Login or Register  to view this content.
    Any suggestions?

    Dion
    Last edited by mojo249; 01-13-2010 at 10:29 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Textbox greater than 255 characters

    Truncate? Works for me without difficulty in Excel 2003.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Textbox greater than 255 characters

    Ah! I see. It's not the process of saving the value from the textbox to the cell which truncates, it's the process of emailing the sheet. 512 characters are saved into a cell on worksheet "EmailCH", but running the following script (to email the sheet) causes the string to be truncated to 255 characters:

    Please Login or Register  to view this content.
    Any advice would be greatly appreciated.

    Dion

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Textbox greater than 255 characters

    Hello mojo249,

    If you want the body of the email to be more than 255 characters, you will need to wrap the body in HTML code or send a shorter body with the remaining information as an attachment.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Textbox greater than 255 characters

    Hi Leith

    When you say wrap the body in html code, do you mean I need to send the sheet as part of the body of the email (such as the code below), rather than as an attachment? The problem is, the recipient need to receive the information as a worksheet so putting it in the body won't work.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Textbox greater than 255 characters

    Never mind - I've found a work around. I've added an extra line in the worksheet - the first 255 characters will be placed in the first cell. The remainder in the second (the 2nd will be hidden if Len < 255):

    Please Login or Register  to view this content.
    Thanks for your time anyway.

    Dion

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Textbox greater than 255 characters

    Hello mojo249,

    If the text length of email body was greater than 255 characters then it would need to be wrapped with HTML tags. From what I see in your post, that doesn't seem to be the case. What is the problem you're having?

  8. #8
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Textbox greater than 255 characters

    Hi Leith

    No...it's most strange (to me anyway...).

    I've attached a workbook showing the worksheet before and after it's sent by the below code. You can see that cell B23 is truncated to 255 characters....

    Dion



    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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