+ Reply to Thread
Results 1 to 6 of 6

Run-time error '91': Oject Variable or with block variable not set

  1. #1
    Registered User
    Join Date
    09-17-2014
    Location
    Mysore
    MS-Off Ver
    ms office 2007
    Posts
    10

    Run-time error '91': Oject Variable or with block variable not set

    please let me know i am getting error on the line


    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Run-time error '91': Oject Variable or with block variable not set

    Hi, bharath.achar,

    Target (I would prefer to use a different name for the variable) has been dimmed as Range but not been assigned anywhere in the sheet before thus causing the error.

    Ciao,
    Hoilger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Run-time error '91': Oject Variable or with block variable not set

    Just add a single quote (') after then like the below

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Run-time error '91': Oject Variable or with block variable not set

    Hi, :) Sixthsense :)

    that would get the comment for the line being covered but not the fact that the range has not been set before and still cause RTE 91 for sure.


    @baig123:
    being banned for some time on a forum doesn´t mean that you should show up with a different username and the very same problems.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    09-17-2014
    Location
    Mysore
    MS-Off Ver
    ms office 2007
    Posts
    10

    Re: Run-time error '91': Oject Variable or with block variable not set

    @Sixthsense :

    Hello Sir i am Not Baig123
    I got this code from excel form, that is using in my project .

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Run-time error '91': Oject Variable or with block variable not set

    Hi Holger,

    Yes, you are right

    As you said the OP should set a range in Target or use If with Is not nothing to skip that range if Target is empty

+ 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: 0
    Last Post: 04-16-2013, 07:15 AM
  2. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  3. Replies: 1
    Last Post: 09-25-2012, 08:03 PM
  4. [SOLVED] Intermittent Run-time Error 91: Object Variable or With Block variable not set
    By fraanchtoast in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-29-2012, 10:11 AM
  5. [SOLVED] Run Time Error 91 'Oject variable or With block variable not set
    By aakash_bh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2012, 03:04 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