1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel VBA error code 91: Object variable or with block variable not set

Discussion in 'Business Applications' started by wilnexpc, Jul 23, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. wilnexpc

    wilnexpc Thread Starter

    Joined:
    Jul 23, 2013
    Messages:
    6
    Is there any known reason a user of workbook would get the error code 91, but someone else does not?
    I cannot really debug the code since I am not getting the error and it's not practical for me to be at the users' machine, nor for me tell them which step to take to help me debug it.
     
  2. Ent

    Ent Trusted Advisor

    Joined:
    Apr 11, 2009
    Messages:
    5,467
    First Name:
    Josiah
    I don't know what the problem is.
    However, if something works fine on one machine and not on another, the obvious question to ask is how are the two computers different.

    Do they have the same versions of Office?
    Was one of them directly involved in creating the macro? For example, there may be problems because it's signed with a local key, or just because it calls code from another document that hasn't been sent.
    Although unlikely to be the issue, is there a chance that there's a Macro virus causing problems?

    Another thing to check is that the "working" computer is actually running the macro.

    If nothing else works, would it be practical to request remote access?
    If yours is not the working machine, is it at least practical to request that they send you the file? If yours is the machine it was developed on, could you ask that they send back the file to check nothing has been changed.
     
  3. wilnexpc

    wilnexpc Thread Starter

    Joined:
    Jul 23, 2013
    Messages:
    6
    thanks Ent for the reply. You are right, the program codes were developped on my machine, I know both machines are using excel 2007.
    I am gonna try to get remote access to the user's computer, and try to get a hold of the copy he is using.
    thanks again for your input, will update you on the status of the problem.
     
  4. wilnexpc

    wilnexpc Thread Starter

    Joined:
    Jul 23, 2013
    Messages:
    6

    His copy works on my machine. I'll try to test it on my home machine.
     
  5. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    In the VBA editor click TOOLS >> REFERENCES and check to make sure there are no missing object libraries. This is pretty common when different version of MS Office are being used. You will either need to set reference to the correct object library or modify your code to use late binding instead of early binding when creating your objects.


    Rollin
     
  6. wilnexpc

    wilnexpc Thread Starter

    Joined:
    Jul 23, 2013
    Messages:
    6
    thanks, I'll try that in the morning. The worksheet works fine on my home machine btw
     
  7. wilnexpc

    wilnexpc Thread Starter

    Joined:
    Jul 23, 2013
    Messages:
    6

    Thanks Rollin!!! That worked, I had him checked for missing libraries, and set up the correct Reference Library, and the error went away!!!
    I really appreciate it, thank you very much!
     
  8. wilnexpc

    wilnexpc Thread Starter

    Joined:
    Jul 23, 2013
    Messages:
    6

    Ent (Josiah), I wanted to thank you as well, it turned out that we were using different version of excel, and also there some missing libraries, fixing that took care of the problem
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1104404

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice