Microsoft KB Archive/74386

{| = Returning More than 255 Characters from a Text Box or Button =
 * width="100%"|

Last reviewed: November 3, 1994

Article ID: Q74386 The information in this article applies to:
 * Microsoft Excel for Windows, versions 3.0, 4.0
 * Microsoft Excel for OS/2 version 3.0

SUMMARY
There is a limit of 255 characters that can be returned using the GET.OBJECT macro function with a Type_num argument of 12. If you attempt to retrieve more than 255 characters with this function, a #VALUE! error is returned. The macro in the example below allows you to retrieve more than 255 characters.

MORE INFORMATION
The form of the GET.OBJECT function is:

=GET.OBJECT(type_num,object_id_text,start_num,count_num) For example, the following =GET.OBJECT(12,&quot;Text 1&quot;,1,20) will return the first 20 characters from TextBox 1. The maximum value that the count_num argument can take on is 255. The example below enables you to extend this maximum.

Example
A1: =FOR(&quot;counter&quot;,1,MaxNum,255) A2: =GET.OBJECT(12,&quot;Text 1&quot;,counter) A3:  A4: =NEXT A5: =RETURN

In cell A1 of the macro above, &quot;MaxNum&quot; should be the number of characters that you would like to retrieve. Each time the loop is executed, 255 characters are returned. The starting position for the characters to be returned changes from 1 to 256 to 511 and so on. The count_num argument can be omitted from the GET.OBJECT function because it defaults to 255.