Application.InputBox screen position doesn't work.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don't care about X in the following code, I just want to control where the
textbox appears onscreen. Changing the values of Left and Top has no effect.
Why? What am I missing?

Sub test()
Dim X
X = Application.InputBox(prompt:="Hello", Left:=10, Top:=10, Type:=5)
End Sub
 
Try this one out
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=10, Top:=10, Width:=88.5, Height:= _
13.5).Select
 
John,

Thank you for your suggestion, but I would prefer a direct answer to my
question as to why the Application.InputBox example I gave does not work.
I'm reluctant to use your suggestion due to added complexity and possible
unintended consequences.

Tom
 
Works for me when I change the numbers for Left and Top.

Sub test()
Dim X
X = Application.InputBox(prompt:="Hello", Left:=310, Top:=100, Type:=5)
End Sub


Gord Dibben MS Excel MVP
 
Gord,

I tried your parameters, but the position of the Application.InputBox did
not budge. I neglected to mention that I dragged the Box to a new location
using my mouse cursor prior to testing the code in my example. I am at a
loss...

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top