+ Reply to Thread
Results 1 to 3 of 3

Select a Textbox from a module upon opening excel

  1. #1
    Registered User
    Join Date
    04-02-2014
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Select a Textbox from a module upon opening excel

    Hello I have this code and i'm receiving an error 424

    Sub Auto_open()
    Dim val As String

    val = InputBox("Enter your Initials", "May I know your Name!")
    Workbooks("CIP_report.xlsm").Sheets("Dashboard1").Range("D2") = val

    Workbooks("CIP_report.xlsm").Sheets("Dashboard1").Range("L23").Activate

    TextBox1.Activate <-------Error
    TextBox1.Text = "" <-------Error

    End Sub
    I'm trying to have the textbox1 be selected and have the blinking cursor in the textbox after OK is pressed from the inputbox.

    This code is in a module...

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Select a Textbox from a module upon opening excel

    Are you sure that you have an object called TextBox1?
    Martin

  3. #3
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Select a Textbox from a module upon opening excel

    Use Textbox1.enabled=true.. for getting the focus..
    instead of activate

    Don't forget to click *

+ 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. Populate TextBox from Module prior to opening TextBox
    By Dabbler39 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2013, 05:50 PM
  2. to refer to a textbox from a module
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2010, 03:05 AM
  3. Erro on opening an excel file - compile error in hidden module
    By mohan_rajun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2010, 05:38 AM
  4. opening Excel 2003-Compile error in hidden module: Autoexcel new?
    By George in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2006, 01:45 PM
  5. Default in a textbox and change a module name
    By filo666 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2005, 04:06 PM

Tags for this Thread

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