runtime error 91

  1. A

    Run-time error 91 when copying cells from one workbook to another

    Hi All I have some code that I am trying to use to copy the contents of a sheet in a workbook to another workbook. However , when the code is run I get "Runtime error 91: Object variable or With block variable" not set error. I have pasted my code below. Any ideas what is causing the error...
  2. A

    VBA Runtime Error 91 with String variable

    Hello, I have had this code working with the text manually entered into the code and I have tested the code in a separate macro on its own but when i put it together it give me this error. I understand it is due to something not having a value set but as it happens on the line setting the...
  3. M

    Object variable or with block variable not set

    Dear Gents, The following code can run well sometimes, but after run other macro , following code show run time error 91: Object variable or with block variable not set Would you please help me to figure out this problem? Thanks. Option Explicit Public rngA, rngB, cell As Range Public a, B, C...
  4. J

    VBA code for Pivot Table results in "Runtime Error 91: Object variable or with block variable not set"

    I am trying to build a macro to refresh multiple pivot tables in a loop without having to use the name of the pivot table "PivotTable1", etc.. I found this code: Sub UpdateWorkStreamIssues_LOOP() ' Sheets("Ambulatory").Select ' UpdateWSIssues Macro LOOP Dim pt As PivotTable For i = 1 To 2...
  5. H

    Run-time error 91

    Hi, I am trying to run the code listed below and I get an run-time 91 error (Object variable or with block variable not set). Could someone please help me to understand why I am getting this error. Thanks. Sub TestCode() Dim mybook As Workbook, ElectricalCableSchedule As Workbook, mysheet As...
  6. R

    Runtime Error 91 when dropdown changes are made the second time

    Good afternoon all. I hope you are doing well. This is my first post here on Mrexcel so please excuse any lapses in formality that I may cause. Thank you all for the valuable information that is provided to this VBA newbie, it has been a great help. I have been working on a complicated userform...
  7. J

    Runtime error 91

    Hello, When Ever I run my code I get the runtime '91': object variable or with block variable not set. Any help? Dim oXL As Excel.Application Set oXL = CreateObject("Excel.Application") oXL.Visible = True oXL.VBE.ActiveVBProject.vbComponents.Import ("\\LG-NAS\Parallax")
  8. E

    Custom VBA Menu gets disabled after runtime error 91

    Hello, Thanks for viewing my thread. I am troubleshooting a macro enabled spreadsheet which adds a custom menu through vba. It does not have an Add-in but adds the menu before Help, so the custom menu appears under Add-Ins. The custom menu is dynamically created on workbook_open() and consists...
  9. M

    Skip multiple empty cells in loop

    I want to leave empty spaces in this spreadsheet for consumable items in an inventory system. It highlights different sections of quantity values with varying minimums. I want to be able to leave up to 10 cells blank in the loop but if i have more than one or two it crashes out. i only started...
  10. M

    Vba issue run time error 91

    Here's a code that I've been working on. It will filter across all sheets, but wont remove the filter past the active sheet. Also in the highlighted area is a runtime error 91: Object variable or with block variable not set Sub filter()<?xml:namespace prefix = o ns =...
  11. C

    Runtime Error '91'

    I am very new to Vb and have got myself into what is a relatively big project for myself. I get the runtime error '91' object varaible or with block variable not set when running this code. I have just pasted the portion that causes the error. Before this portion of the script it is being...
  12. V

    Runtime error 91

    Hi, I'm trying to find a text in a sheet and pass adjacent value to another sheet. While running the code given below, I'm getting runtime error 91. I tried many options, but in vain. Kindly help.Please find the code below Sub assign_to_pp(tosht As String, fromsht As String) Dim u, v As...

This Week's Hot Topics

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top