+ Reply to Thread
Results 1 to 4 of 4

How to solve : run-time error 91 object variable or with block variable not set

  1. #1
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    950

    How to solve : run-time error 91 object variable or with block variable not set

    Hi All,

    In the attached file, whenever a cell under column D of DM PR Availability sheet is selected as Do Not Disturb, its timestamp is captured in the sheet DND timestamps.

    All was working perfectly. However, all of a sudden, when i try to select Do Not Disturb now, excel shows below error:

    run-time error 91 object variable or with block variable not set

    Can someone guide and resolve the issue.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by rizwanulhasan; 03-02-2022 at 02:27 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: How to solve : run-time error 91 object variable or with block variable not set

    Your VBA is password-protected, so can't be read!
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    950

    Re: How to solve : run-time error 91 object variable or with block variable not set

    Sincere apologies. I forgot to mention password.

    Pass= 123 for all locked sheets/VBA.

    Perhaps i got the issue.

    Whenever, the DND status in DM PR Availability sheet is set to Do Not Disturb, apart from the timestamp capture in DND Timestamps sheet, its count is also being captured in DM Dashboard sheet from row 7 under columns M.

    Due to the pivot table additional data, the entries were moved and thereafter i am getting error. If i delete 2 columns, then all works fine.

    However, i would like to remove these counts from DM Dashboard sheet since its already being captured in DND Timestamps sheet.

    If not, the counts are to be moved to column AC in DM Dashboard sheet.

    Can you please modify the VBA and do the needful.

    Many thanks.
    Last edited by rizwanulhasan; 03-02-2022 at 02:28 PM.

  4. #4
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    950

    Re: How to solve : run-time error 91 object variable or with block variable not set

    Hey sweep,

    I got a temporary solution. Just changed 2 lines in the VBA code from K to AA.

    However, timestamps not being captured in DM Dashboard sheet.

    But at least no VBA error now.

+ 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. [SOLVED] Adding attachments to outlook - "Run-time error 91: Object variable or With block variable
    By Deniouz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2021, 12:22 PM
  2. [SOLVED] fixing run time error 91 object variable or with block variable not set
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-07-2020, 06:26 AM
  3. Replies: 12
    Last Post: 12-28-2019, 12:29 PM
  4. [SOLVED] Trying to solve Error 91 (Object variable or With block variable not set)
    By Seth_ in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-23-2016, 10:49 AM
  5. [SOLVED] Run-time error '91': Object variable or With block variable not set when closing userform
    By bishoposiris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2016, 08:59 AM
  6. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  7. [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

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