+ Reply to Thread
Results 1 to 5 of 5

Object Variable or With Block variable not set

  1. #1
    Registered User
    Join Date
    09-17-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    2

    Object Variable or With Block variable not set

    Hi, I have written the code below but for some reason the line highlighted in bold gives the error "Object Variable or With Block variable not set". Any help on how to solve this would be much appreciated. Thanks in advance

    Please Login or Register  to view this content.

    Moderator Note:


    Pls use code tags around your code as per forum rules.
    Last edited by Fotis1991; 09-17-2013 at 07:17 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Object Variable or With Block variable not set

    Not sure which line is bold (doesn't show up for me) but in the third line you have ClacsNew which is presumably a typo and should be CalcsNew.

    If you are running this without option explicit, this maens that when you come to use CalcsNew it hasn't previously been defined and is still empty...

    Note, use option explicit wherever possible as it will make errors like this one very obvious.

  3. #3
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Object Variable or With Block variable not set

    Hi

    "CalcsNew" is declared but "ClacsNew " is set

    to prevent those errors write "Option Explicit" at the top of the module outside of the sub. This will force you to declare variables, typos will be spotted earlier
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  4. #4
    Registered User
    Join Date
    09-17-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Object Variable or With Block variable not set

    thank you for your help. I'll try to be a bit more vigilant when posting in future

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Object Variable or With Block variable not set

    Thanks for understanding!


    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. Replies: 1
    Last Post: 07-24-2013, 02:45 PM
  2. Replies: 4
    Last Post: 07-12-2013, 12:14 PM
  3. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  4. Replies: 1
    Last Post: 09-25-2012, 08:03 PM
  5. Error 91 object variable block variable not set when importing a CVS file
    By ReportBuilder2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2011, 11:48 AM

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