+ Reply to Thread
Results 1 to 6 of 6

VBA: Textboxes Unable Exceed 255 Characters

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    7

    VBA: Textboxes Unable Exceed 255 Characters

    Hello. I've been having an issue with Excel 2003 and its limit of 255(?) characters when populating a textbox with a macro. Basically, what I want to do is have Excel read a few cells and write a customized message into a textbox, which can then just be copied into an actual e-mail. It takes a few cells, and customizes the e-mail based on the name and some other information.

    Here's what I had:

    Please Login or Register  to view this content.
    This code works flawlessly for my needs in Excel 2010 (at home), but in Excel 2003 (at work) it will not populate the textbox with more than 255 characters. At 254 it runs fine, but then as soon as you put that extra character in it still runs, but nothing shows up in the box.

    I've looked around and I cannot get anything working.


    This link shows the problem: http://support.microsoft.com/kb/105416
    I tried both Example 1 and 2 and they both stop at "
    With DialogSheets(1).TextBoxes(1)" with error “Run-time error ‘9’: Subscript out of range”


    I'm not really sure what I'm doing wrong, or maybe I'm completely missing something that I should be putting in with those examples. I'm kind of new to VBA.

    Any help would be much appreciated.

    Thanks!

  2. #2
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Huntsville, AL
    MS-Off Ver
    Excel 2007
    Posts
    180

    Re: VBA: Textboxes Unable Exceed 255 Characters

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VBA: Textboxes Unable Exceed 255 Characters

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    09-23-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: VBA: Textboxes Unable Exceed 255 Characters

    Thanks. I will see where these get me when I get in to work tomorrow. It works just fine in 2010.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: VBA: Textboxes Unable Exceed 255 Characters

    There are two types of textboxes you could add to a worksheet. The one you are using now is from the Drawing toolbar. The other type is an ActiveX object from the Control Toolbox toolbar. The ActiveX-type Textbox is not limited to 255 characters.

    Overview of forms, Form controls, and ActiveX controls on a worksheet


    Example code to set text to an ActiveX-type textbox.
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  6. #6
    Registered User
    Join Date
    09-23-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: VBA: Textboxes Unable Exceed 255 Characters

    Just wanted to give a quick update.

    AlphaFrog's solution worked perfectly. Big thanks for that, this had been a major headache!

    Norie, your solution did the same as what I had before, it just did nothing at all.

    Gregg yours I think just gave some visual feedback but didn't help with increasing the capability.

    Thanks again to AlphaFrog!

+ 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. A1 Cannot Exceed Value of B1
    By dompoma in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2013, 05:13 PM
  2. Replies: 3
    Last Post: 11-08-2012, 07:25 PM
  3. Autofit if characters in cell exceed column width
    By munkayboi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2007, 03:45 PM
  4. Exceed 255 characters on a text box on a form
    By collierd in forum Excel General
    Replies: 1
    Last Post: 01-22-2007, 09:43 AM
  5. [SOLVED] Footer exceed max characters
    By Carol in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-21-2006, 12:15 PM

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