LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Maximum length Prompt in Application.InputBox

Was caught out by the fact that the maximum length of the Prompt in
Application.InputBox is much less than in the
regular InputBox. The trouble was that the error you get is Runtime error
13: Type mismatch, so I was looking at the
datatypes of the different arguments, but the trouble is not with those.
The other trouble was that this seems to be mentioned nowhere.

It looks the maximum lenght of the Prompt with Application.InputBox is 256:

Sub test()

Dim i As Long
Dim lResult As Long
Dim strResult As String

On Error GoTo PAST1
For i = 245 To 400
SendKeys "{ENTER}", False
lResult = Application.InputBox(String(i, "x"), "title", 10, Type:=1)
Next

PAST1:
MsgBox i, , "maximum prompt length with Application.InputBox"
MsgBox i, , "maximum prompt length with Application.InputBox"

On Error GoTo PAST2
For i = 200 To 10000
SendKeys "{ENTER}", False
strResult = InputBox(String(i, "x"), "title", "a")
Next

PAST2:
MsgBox i, , "maximum prompt length with InputBox"
MsgBox i, , "maximum prompt length with InputBox"

End Sub


Haven't found the maximum yet with the regular InputBox, but it is much
more.

Is this is a known problem? I suppose it is.
Is there a workaround? I suppose not.


RBS

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit text length with inputBox BigDave[_7_] Excel Programming 2 June 10th 05 07:11 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
InputBox function - prompt string limit Marcotte A[_2_] Excel Programming 4 June 9th 04 09:47 AM
What is maximum length of URL? Kiloran[_3_] Excel Programming 1 April 14th 04 12:39 PM
String length of Inputbox user input. Hersh Excel Programming 2 July 14th 03 08:47 PM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"