object variable

  1. S

    Run Time Error 91, Object Variable or With Block Variable Not Set

    Hey everyone, So I will spare you some of the smaller details, but I am basically writing a code that cycles through all sheets in a workbook, looks for a specific range and then copies and pastes it to another sheet accordingly. The trouble part of the code right now is right at the beginning...
  2. X

    Set Object Variable inside an If/ElseIf Statement (Run-time error 5)

    This macro keeps giving me a run-time error '5'. Dim myOlApp As Object Dim MyItem As Object Set myOlApp = CreateObject("Outlook.Application") If Range("C6").Value = "June" Then MyItem = myOlApp.CreateItemFromTemplate(JuneTemplate) 'THE ERROR HIGHLIGHTS...
  3. J

    Dynamic Data Source for Chart uses Workbook name - needs to use a variable

    I have an Excel 2010 file that contains a chart that uses an ActiveX combo box to select the data series based on a named range in another worksheet. I was having difficulty with the chart replacing the named range with the static cell reference range. My solution was to run a macro on change...
  4. 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...
  5. C

    Object vairable - 91 error on setting a worksheet variable

    OK, so I have this code here, which will let me know whether the info entered is new data or changes to old data and put it into the correct sheet depending on which it is. Problem is, when I get to the if statement, when it gets to ws2= it causes the run-time error 91: Object variable or...
  6. K

    Object variable or With block variable not set error for multiple report based on a template

    Hello, I am trying to generate Report using a predefined template. I select the reports i want from a listbox then run the macro. The first report generates successfully; however the second report will cause an error: "Object variable or With block variable not set " when calling a table from...
  7. R

    ActiveWorkbook.ActiveSheet.Name Run-time error 91 / Object variable not set

    I am running the following code on one of my worksheets ("Deal Info" / Sheet3) however for some reason one of the users of this workbook is getting a Run-time error '91': Object variable or With block variable not set message when they open another workbook and this one is open. Here is the...
  8. J

    Problem executing public subroutine!

    I have two different forms (Class1 and Class2) which are similar and both of them have object ComboBox1. Because these ComboBoxes have same list of values I created Public subroutine in one of Modules to run certain macro when certain value from ComboBox is selected: Public Sub RunMacro1...
  9. D

    Error 91 Object Not Set: Can I initialise variables via code? [Excel 03]

    I'm attempting to write some code that creates a toolbar with some buttons on it that carries out some simple instructions; this is just a test before I try and incorporate it into the real spreadsheet. The first sub creates the toolbar and its commandbarbuttons and their properties. The second...
  10. S

    What is the difference between variables and object variables?

    Hi all, i have some difficulty in understanding the purpose of both types of variables in excel macro. Furthermore, i have a problem in my codes right now, Dim TotalRow As Integer Set TotalRow = ActiveSheet.Rows.Count ActiveCell.Copy For i = 1 To TotalRow...
  11. D

    Setting a workbook object with full path

    Can someone help please. I want to Set wkb as the workbook<TABLE style="WIDTH: 198pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=264><COLGROUP><COL style="WIDTH: 198pt; mso-width-source: userset; mso-width-alt: 8448" width=264><TBODY><TR style="HEIGHT: 12.75pt...
  12. B

    Code near completion, runtime error

    Hello, I have a large column of UPC numbers I wish to identify. This code is designed to enter a search for UPCs at http://www.upcdatabase.com/itemform.asp. Then it copies the url of the search results page and pastes it in Excel 2007 next to its matching UPC. The end result should be a column...
  13. B

    Broken Code Importing data from Internet Explorer

    Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> <o:p> </o:p> This code is designed to enter a search for UPCs at http://www.upcdatabase.com/itemform.asp. Then it copies the url of the search results page and pastes it in excel next to its matching...
  14. S

    Excel-Outlook Problem

    Hi, My first post here. Please excuse if any forum-rules have not been followed :) I'm trying to send the contents from an Excel Worksheet through Outlook E-mail. The contents of the email comes from various sections of the Worksheet. Therefore, I'm using the following code to set up the...

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
Back
Top