Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DZ DZ is offline
external usenet poster
 
Posts: 29
Default Txtbox set focus

Hi

I have placed a textbox on a worksheet from the Controls toolbar.

How can I set the focus on the textbox when the workbook is opened. I can't
find a method to set the focus to this control.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Txtbox set focus

just a question.
you try the
ActiveSheet.Shapes("TextBox1").setfocus '--- ?

--
üdv:regards
L@ja


DZ ezt *rta:

Hi

I have placed a textbox on a worksheet from the Controls toolbar.

How can I set the focus on the textbox when the workbook is opened. I can't
find a method to set the focus to this control.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Txtbox set focus

ActiveSheet.Shapes("TextBox1").setfocus '--- ?
That give me a 'Run-time error '438'
Object doesn't support this property or method
on my XL97. What version are you? Dave D-C

L@ja wrote:
just a question.
you try the
ActiveSheet.Shapes("TextBox1").setfocus '--- ?
--
dv:regards
L@ja


DZ ezt rta:
Hi
I have placed a textbox on a worksheet from the Controls toolbar.

How can I set the focus on the textbox when the workbook is opened. I can't
find a method to set the focus to this control.

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Txtbox set focus

Option Explicit
Sub Auto_Open()
Worksheets("sheet1").TextBox1.Activate
End Sub

In xl2003, I didn't have to select the sheet first.

If this doesn't work, try:

Option Explicit
Sub Auto_Open()
with worksheets("Sheet1")
.select
.TextBox1.Activate
end with
End Sub

DZ wrote:

Hi

I have placed a textbox on a worksheet from the Controls toolbar.

How can I set the focus on the textbox when the workbook is opened. I can't
find a method to set the focus to this control.

Thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
DZ DZ is offline
external usenet poster
 
Posts: 29
Default Txtbox set focus

Thanks for your responses. It's Excel 97.

I get 'Run-time error '438' with Activate. There doesn't seem to be a way to
do this with a Controls Toolbar textbox.

Regards

DZ


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Txtbox set focus

It worked ok in xl2003 for me.

But I don't have xl97 to test.

DZ wrote:

Thanks for your responses. It's Excel 97.

I get 'Run-time error '438' with Activate. There doesn't seem to be a way to
do this with a Controls Toolbar textbox.

Regards

DZ


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Txtbox set focus

In Module1:
Sub Auto_Open()
Sheets("Sheet1").TextBox1.Activate
End Sub

This works in my XL97 -- doesn't need sheet select.
I wonder what could be different? Dave D-C

Dave Peterson wrote:
It worked ok in xl2003 for me.
But I don't have xl97 to test.


DZ wrote:
Thanks for your responses. It's Excel 97.

I get 'Run-time error '438' with Activate. There doesn't seem to be a way to
do this with a Controls Toolbar textbox.

Regards

DZ


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Txtbox set focus

Maybe the user made a typing error????

Who knows?

Dave D-C wrote:

In Module1:
Sub Auto_Open()
Sheets("Sheet1").TextBox1.Activate
End Sub

This works in my XL97 -- doesn't need sheet select.
I wonder what could be different? Dave D-C

Dave Peterson wrote:
It worked ok in xl2003 for me.
But I don't have xl97 to test.


DZ wrote:
Thanks for your responses. It's Excel 97.

I get 'Run-time error '438' with Activate. There doesn't seem to be a way to
do this with a Controls Toolbar textbox.

Regards

DZ


--

Dave Peterson
Reply
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
allow entry in only one txtbox CR[_2_] Excel Programming 0 December 13th 06 09:24 PM
Keeping focus on a txtbox 2 Tim[_44_] Excel Programming 2 April 8th 06 02:18 AM
Keeping focus on a txtbox Tim[_44_] Excel Programming 1 April 8th 06 12:56 AM
Keeping focus on a txtbox Tim[_44_] Excel Programming 4 April 6th 06 04:54 PM
To put value from txtbox to cell? Samick Excel Programming 1 November 13th 04 10:57 AM


All times are GMT +1. The time now is 04:26 PM.

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

About Us

"It's about Microsoft Excel"