error 91

  1. T

    Excel VBA Runtime '91' error during lookup in Internet Explorer

    Good day. I am trying to lookup some Warranty Expiration dates via Internet Explorer and return the results to and Excel spreadsheet. Currently the code is very rudimentary. I have not yet added to code to read serial number from the worksheet or write the results back to the spreadsheet. I just...
  2. H

    Error 91 concerning Objects or with Bloc but I dont have anything like this in my code

    Hello, I have a small problem. My code is running half of the time. When I press on my command button, my code works fine. When I repress on it to try something else, my code isnt running and I have an error 91. I press on end and retry my command button and it works fine. I dont know what is my...
  3. B

    Error 91 when save and close workbook and stops making a backup file.

    Hello In my code to export a query to Excel, I am trying to adapt the code from Titleist23 https://www.mrexcel.com/forum/excel-questions/584129-disable-access-excel-backup-file-vba.html to save and close the workbook and stops making a backup file. This is my code working fine to export a query...
  4. B

    Excel 2016 error91 setting xlPrimary axis and xlSecondaryaxis to none

    Hello I have a Chart in a Worksheet. In the Chart, I am trying to set xlPrimary axis and xlSecondaryaxis to none. I opened the workbook in Excel and made the changes manually with the Recorder on. This is the recorded macro code: ActiveChart.Axes(xlValue, xlSecondary).Select...
  5. B

    VBA Giving Run-time error '91'

    I'm using the following to return links from a search on Google: Sub XMLHTTP() Dim url As String, lastRow As Long Dim XMLHTTP As Object, html As Object, objResultDiv As Object, objH3 As Object, link As Object Dim start_time As Date Dim end_time As Date lastRow =...
  6. I

    Trying to save and close excel (2007) from ms access (2007) vba

    Still learning Ms Access vba but learning fast. I am not understanding fully and I am stumped on just on two things of which I am sure solve one, the other will also be solved. Spent the last 2 days with no progress. :( I have a button on my form opening my excel spreadsheet (template)...
  7. K

    Error 91 - Defining variables

    Hello and thank you for your time. I have created a report that is shared with clients that has a private sub for when the workbook opens. One of my clients is getting an issue with the bold line of code. Here is some basic information: I wrote the code/created the workbook in Excel 2016...
  8. S

    End sub creates "Runtime Error 91: Object variable or with block variable not set"

    Apparently this happens when a variable is not defined, but all mine are, as far as I can tell. Also, when debugging, the error appears on the End Sub line. That is, the macro (seems to) exit correctly, but as it exits I get the error msg. If the error box could be forced to not appear it would...
  9. K

    Run time error 91

    I am developing a spreadsheet for analysing expenses & other costs. The data will be in one of the tabs, the full name of which is not known but we know that the name starts with a known string - in this case "statement". What I want is the end of the name: F_Nam. What have I done wrong ? I...
  10. S

    Creating a Pivot Table with VBA

    Hey guys, I am trying to create a pivot table with VBA based off of some data that I have. Here is my code: Option Explicit Dim dolSht As Worksheet, hourSht As Worksheet Dim sumSht As Worksheet, byCustSht As Worksheet, allCostSht As Worksheet Dim ptCache As PivotCache Dim pt As PivotTable...
  11. S

    VBA Error '91' on ActiveWorkbook.Save

    Hi All, Long time user, first time poster here. I put that down to may other people having the issues I have before I do and then the Gurus here sorting them out in a very well written way so thanks for that. I however have an issue I have been unable to find the resolution to. I recently wrote...
  12. P

    HELP - Error 91 with recorded macro

    Hey so i am trying to make a macro that executes the find next -> replace all path. Highlight a column and replace certain values in the column with a different value. i have no experience with VBA so i used the record a macro button in excel. The resulting macro gives me an error 91 when i try...
  13. M

    Worksheet_change Error 91

    First time writing worksheet_change code and I have gotten 2 codes to work, but I cannot get them to work together. The first piece of code is just to hide and unhide tabs, and it works until I paste the second piece of code which is to replace cell values when entered into a specific range...
  14. R

    Attempting to Highlight Cells Based on String within Cell

    Hello! Basically what I'm trying to do is the following: First, determine if I'm in the correct row of cells based on the String value of the cell. i.e If the current cell's string value contains the string AB1 or AB2, go through the entire row. Once that has been determined, I would like to...
  15. F

    Error 91 when using CopyHere to extract a zipped file

    I have a piece of code that creates a list of files in a folder. I then loop through the list and take different actions depending on the file type. One action is to extract a csv file from a zipped file. I then have a sub procedure to do the extracting if for each .csv file in the zipped on...
  16. T

    Handle Error Code 91 and Move on to Next Operation

    Hello, Help with this would be much appreciated. I wrote a program that seeks out a specific string and modifies the format of it's cell once it is found. Sometimes the string will exist on the sheet and sometimes it won't. I need the program to keep running and do its job if the string isn't...
  17. 9tanstaafl9

    Error 91 when using On Error GoTo. Works first time but not second.

    Is there some sort of rule against having more than one On Error Goto? I have two On Error Goto's in my macro, both of which WORK PERFECTLY if the other is commented out, but only the first works if they are not commented. I'm sure I'm missing something really basic but I can't figure it out...
  18. M

    Why simple Open_Workbook Macro works perfectly but error 91 when opened on another computer??

    Hello guys I am so frustrated. 2 days trying to decipher this. I have emailed a spreadsheet to all my internal customers and they all get the same error "Run-time error 91: Object Variable or with block variable not set" We all work on Excel 2010... so I don't think that's the problem When...
  19. S

    Dynamic Cell setup (Based on click to copy)- Error 91

    So here is my code Sub Worksheet_SelectionChange(ByVal Target As Range) 'single click version Range("J3:J32").Interior.Color = RGB(200, 160, 35) Range("K3:K3").Interior.Color = RGB(200, 160, 35) If Intersect(Target, Range("J3")) Or Intersect(Target, Range("J4")) Is Nothing Then Exit Sub...
  20. R

    Range Validation Error

    Trying to valdate a couple of cells before I allow the file to be saved and sent via email. I keep getting the error: (References the line of code "PName = Range("A3:D3") on Debug) Run-time error '91': Object variable or With block variable not set Not sure what my error is or if there's an...

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top