+ Reply to Thread
Results 1 to 6 of 6

Compile Error: Object Required, while reading integer values from textbox on button click

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    Jersey City
    MS-Off Ver
    MS2007
    Posts
    3

    Unhappy Compile Error: Object Required, while reading integer values from textbox on button click

    Please see my code below and advise. I am getting the error at the arrow marked steps.
    Getting 'Compile Error: Object Required' for the below. And when I remove the 'Set' in the below, I get 'Runtime error 424: Object Required'
    Please Login or Register  to view this content.
    Last edited by Sreekanthev; 05-18-2016 at 03:40 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Compile Error: Object Required, while reading integer values from textbox on button cl

    Month and year are just integers, so do not use Set to assign objects to them.
    Please Login or Register  to view this content.
    would be enough.

    PS. please edit your post and place code tags as per Rule 3 of our Forum [/I]RULES
    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Edit the post and highlight your code and click the # icon at the top of your post window
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    Jersey City
    MS-Off Ver
    MS2007
    Posts
    3

    Re: Compile Error: Object Required, while reading integer values from textbox on button cl

    Thank you for the reply and for the tips. I am a new user and I am yet to get used to the rules.

    As advised, I have removed 'Set' while assigning objects and now it throws 'Runtime Error 424- Object required'

    I am trying to read the numbers from text field and use them in building the workbook name to open.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Compile Error: Object Required, while reading integer values from textbox on button cl

    Where do you now get the error?

    By the way using Month and Year as variable names is a bad idea as they are both VBA functions.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    Jersey City
    MS-Off Ver
    MS2007
    Posts
    3

    Re: Compile Error: Object Required, while reading integer values from textbox on button cl

    Hi Norie,

    I am getting the error at the below marked steps where I am assigning the objects to month and year. I have tried changing the names to X and Y just to check if the error is caused as 'Month' and 'Year' are inbuilt VBA functions.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Compile Error: Object Required, while reading integer values from textbox on button cl

    Is this code in standard module or in userform code? and where textboxes are? on the userform or on a sheet?

+ 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. Compile Error - Object Required when opening Userform on another PC
    By Scoobymoo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2015, 05:48 AM
  2. [SOLVED] Compile Error: Method or data member not found when i click Save button...
    By aditbaco in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-15-2013, 07:11 AM
  3. [SOLVED] Object Required Error - Need to modify button
    By jeff_kaufman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2013, 12:19 PM
  4. Compile error: Object required
    By Hinnerk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-23-2012, 04:38 PM
  5. Object required error on CommandButton Click
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-09-2011, 06:05 PM
  6. Compile error : object required in userform
    By asha3010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2010, 04:08 AM
  7. [SOLVED] VBA Help needed -- compile error: object required
    By alexandraVBAgirl in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-17-2006, 09:00 AM

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