Results 1 to 2 of 2

error unless I include a dummy Sub

Threaded View

leonmcd error unless I include a... 05-25-2011, 08:40 AM
royUK Re: odd behavior 05-25-2011, 09:53 AM
  1. #1
    Registered User
    Join Date
    05-25-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    1

    error unless I include a dummy Sub

    I have a working VBA program that I decided to clean up.
    I rearranged some Subs and Functions and got an error.
    Error 91 Object variable or With block variable not set.
    The error is on the fr Range variable in a Sub farther down in the code

    After much trial and error I discovered that I could eliminate the problem by adding a dummy sub at the start of the code

    code looks like ...

    Sub dummy()
        ' code will not work without  this dummy routine
        ' don't know why
    End Sub
    
    Dim fr As Range
    
    Sub getNewBadChecks() ...
    If I comment out the dummy Sub I get the error.

    Every seen anything like this ? What's the fix?
    Last edited by leonmcd; 05-25-2011 at 10:43 AM.

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