+ Reply to Thread
Results 1 to 2 of 2

The pesky "Object variable or With block variable not set" error

Hybrid View

  1. #1
    Registered User
    Join Date
    12-01-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    1

    The pesky "Object variable or With block variable not set" error

    I've been searching online for clues on how to fix this error (there are plenty of cases)... but I can't find any example that would really help figure this one out. I'm getting the "Object variable or With block variable not set" error when I click on my click button.

    Public ConnectMM As Object
    Public GraphletsMM As Object
    
    Sub Gather()
     
        On Error GoTo Recover
        
        Dim x
        
        InitializeEP
        Application.Cursor = xlWait
        x = ThisWorkbook.ConnectMM.ReadTableVec(Worksheets("Main Table").Range("B3"), Worksheets("Main Table").Range("B4"), 0, 3, 0, Worksheets("Main Table").Range("c3:k27"))
        Application.Cursor = xlDefault
        If x <> "OK" Then MsgBox x
        
        Exit Sub
        
    Recover:
        If Err.Number = 424 Then
            InitializeEP
            Resume
        Else
            MsgBox Err.Description
            Application.Cursor = xlDefault
        End If
    End Sub
    Any assistance would be greatly appreciated.

    Thanks!
    Pedro
    Last edited by Cutter; 08-22-2012 at 05:58 PM. Reason: Added code tags

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: The pesky "Object variable or With block variable not set" error

    @ pjmulero

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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