Macro works on all machines save one

Downes51

New Member
Joined
Mar 30, 2016
Messages
26
Hello.

I have a macro which runs perfectly on my Excel 2013 system on my home PC.

It also works fine on most of the other computers at my workplace.

But there's one machine (also running Excel 2013) that when it reaches this bit of code;

ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown

stops and tells me that copy and paste areas are different shapes.

I'm wondering why that should be...... might it be something to do with the way Excel is set up on the rogue computer?

Hope someone can help!

John
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
There isn't anything special above that block of code you posted that would cause issues. That is pretty basic stuff.
I would be more inclined to think it is an issue with the workbook and data in it that they are working with.

That should be easy to prove. Find a workbook where it DOES work on your computer, then test that exact same workbook on the problem computer.
Vice versa, take the workbook that they are having problems with and try it on your computer.

If you step through the VBA code line-by-line while watching what is happening on the worksheets, it may become evident what the issue is.
 
Upvote 0
Hello and thank you for your reply.

Yes, I've tried all that. I'm not really expecting a solution to this, having mentally shelved the problem in the "just one of those things" department. The only thing I will say is that the problem computer is the slowest in the office. But it's not problematic in any other area (that I have noticed), it runs Sage 200, Outlook and so on without obvious problems. Excel works, though it can be very slow.

I'm just going to issue an instruction that if the macro fails, they run it on another one! The files are all networked, so it doesn't really matter which work-station is being used.

John
 
Upvote 0
On the offending PC(s) you could in its Eccel file goto the VBA code and enter the 2 lines:

On Error Resume Next << b4 your 2 lines
On Error Goto 0. << after your 2 lines

STEP THRU CODE... if it doesn't cause error -- SAVE IT and carry on...
 
Upvote 0
Just a silly question but what happens when you take the selects out i.e.
Code:
ActiveCell.EntireRow.Insert Shift:=xlDown
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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
Back
Top