Macro works on one computer but not another

SebN1

Board Regular
Joined
Aug 3, 2007
Messages
50
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.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,449
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
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
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
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
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,449
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
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
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251

ADVERTISEMENT

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
 

KayWill

New Member
Joined
Jan 22, 2015
Messages
36
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"
 

peterhw

New Member
Joined
Jan 23, 2012
Messages
39

ADVERTISEMENT

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
 

peterhw

New Member
Joined
Jan 23, 2012
Messages
39
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
 

peterhw

New Member
Joined
Jan 23, 2012
Messages
39
Now allowed Microsoft to perform a further 30 or so updates and not even the above works !
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,893
Messages
5,834,273
Members
430,273
Latest member
Windrunner

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
Top