Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: Macro works on one computer but not another

  1. #1
    Board Regular
    Join Date
    Aug 2007
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Macro works on one computer but not another

    Hi all,

    I've had a long search through your pages to see if this question has been answered before but having browsed through about 50 pages worth of threads I couldn't see anything, but if I am repeating prior information I do apologise.

    I've written a macro that is relatively simple. It just takes some information in one format, rearranges it, adds some formatting and performs some calculations. Nothing incredibly fancy but it works fine on my computer.

    Now, I need to share this macro with some other people, so basically I've just sent that excel file on to the people that need to use it. Should be fine and in most cases it is, however there is one user who although they can open the file, can't seem to get the macro to run properly.

    It seems to get a small way through the macro but then stop with no error messages or any sign that it hasn't completed properly.

    I have checked Macro Security level and that is the same as mine, Tools - Add-Ins is the same, In Visual Basic, Tools - References is the same as mine. It is the same Operating system and the same version of Excel.

    I have even signed into this person's computer as myself (it's a big company network thing) and tried to run the macro and it works fine, so there is nothing wrong with the hardware.

    I've googled and searched and tried everything I can think of but I'm no closer to solving this problem, so if anyone has read through this wall of text and can come up with a possible solution, that would be greatly appreciated to save me from tearing ALL my hair out!

    Thanks very much for your time.

  2. #2
    MrExcel MVP Andrew Fergus's Avatar
    Join Date
    Sep 2004
    Location
    New Zealand
    Posts
    5,420
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default

    Hi and welcome to MrExcel!

    That sounds frustrating. Can you sit and watch while this other person does what they normally do? In the absence of anything different check to see if the individual is doing something different.

    Have you also tried stepping through the code when logged in under the other users name to see what happens?

    Andrew
    ~ >*()))><(


    I'd rather have a full bottle in front of me than a full frontal lobotomy.

  3. #3
    MrExcel MVP
    Moderator
    SydneyGeek's Avatar
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    12,255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default

    Just wondering...

    If there are errors that don't show, look to see if the code has
    Code:
    On Error Resume Next
    anywhere in it. This tells VBA to skip an error and try the next line. No problem, but if you don't put
    Code:
    On Error GoTo 0
    somewhere after the Resume Next line, you will never show error messages. However, the code may just refuse to run, or run incorrectly.

    Another possibility: There is an error handler that says something like
    Code:
    On Error GoTo Err_Handle
    Then, Err_Handle just has Exit Sub with no message box. The code will run until it hits an error, then silently get out.

    OK, that's some possible behaviour. Possible cause: new user is missing a reference to a code library hat you have referenced on your machine. In the code window, go to Tools > References and search for any that are MISSING. Deselect each missing ref, scroll down and find the corresponding version on your machine, check it and click OK.

    Denis
    Self-preservation: For when you've got yourself in a jam
    ------------------------------------------------------
    My site contains a number of Excel and Access Resources

  4. #4
    MrExcel MVP Andrew Fergus's Avatar
    Join Date
    Sep 2004
    Location
    New Zealand
    Posts
    5,420
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default

    Hi Denis

    Nice catch with the errors. My first thought was either a version problem or a missing reference but the OP did mention this :
    I have checked Macro Security level and that is the same as mine, Tools - Add-Ins is the same, In Visual Basic, Tools - References is the same as mine. It is the same Operating system and the same version of Excel.
    Cheers
    Andrew
    ~ >*()))><(


    I'd rather have a full bottle in front of me than a full frontal lobotomy.

  5. #5
    MrExcel MVP
    Moderator
    SydneyGeek's Avatar
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    12,255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default

    Hmmm... also noticed that, if SebN1 signs in on the rogue machine as himself, it's OK.

    SebN1:
    Is there something different in the user profiles? Maybe the problem occurs when one user's directory permissions are not the same as yours. Does the file require links from another file in a different directory, and do their permissions and / or file mappings differ from yours? If so, try altering those settings in the code and see how you go.
    I still think there's something possibly happening with the error handling.

    Denis
    Self-preservation: For when you've got yourself in a jam
    ------------------------------------------------------
    My site contains a number of Excel and Access Resources

  6. #6
    New Member
    Join Date
    Jan 2015
    Location
    Ohio
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Re: Macro works on one computer but not another

    Quote Originally Posted by SydneyGeek View Post
    Hmmm... also noticed that, if SebN1 signs in on the rogue machine as himself, it's OK.

    SebN1:
    Is there something different in the user profiles? Maybe the problem occurs when one user's directory permissions are not the same as yours. Does the file require links from another file in a different directory, and do their permissions and / or file mappings differ from yours? If so, try altering those settings in the code and see how you go.
    I still think there's something possibly happening with the error handling.

    Denis
    "was this ever resolved? I am having the exact same issue. Other user is on the same network, even linked spreadsheet in the shared drive, changed location and macro still will not work on other machines but works fine on mine. All running Windows 8.1"

  7. #7
    New Member
    Join Date
    Jan 2012
    Location
    Ayrshire,Scotland
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Macro works on one computer but not another

    I noticed this thread which started ages ago and had a recent addition from KayWill.
    Not necessarily a solution but again some 'weird' observations

    I have a desktop which needed a rebuild so I temporarily copied my data across to an old laptop (also new Windows 7 installation). My EXCEL programs - with VB macros - all worked fine with some minor changes of addresses etc.
    Eventually I returned everything to the desktop but my macros just appeared to do nothing and gave an error message (below). Initially I copied all my data via a USB drive. Then I tried again using a memory stick for just a group of Excel programs (and initially ran from the memory stick).
    The error was
    RUN TIME ERROR 32809
    Application defined or object-defined error
    Just no idea what to do at the moment - have un-installed and re-installed Office
    Any help / suggestions appreciated

  8. #8
    New Member
    Join Date
    Jan 2012
    Location
    Ayrshire,Scotland
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Macro works on one computer but not another

    written a very simple macro (below) which works fine

    Code:
    Private Sub CommandButton1_Click()
    Dim int1 As Integer
        int1 = Sheets(ActiveSheet.Name).Cells(1, 1)
        int1 = int1 + 7
        Sheets(ActiveSheet.Name).Cells(1, 1) = int1
    End Sub

  9. #9
    New Member
    Join Date
    Jan 2012
    Location
    Ayrshire,Scotland
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Macro works on one computer but not another

    Now allowed Microsoft to perform a further 30 or so updates and not even the above works !

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •