VBA code works on works desktop but not on my own laptop

Monojono

New Member
Joined
Nov 20, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hello Readers and hopefully problem solvers,

I have a large amount of coding across my workbook that works fine on my works desktop. However, on my laptop one small sub routine stops half way into the code and I can't seem to find the answer to getting it working.

As I said and code works OK on my works desktop but not on my laptop.

The code is as follows:

Sub NoneGasRoundEntrie()

Sheets("SCORECARD").Select

Range("AV7").Value = Range("P3").Value

Range("AV7").Select

Dim GolferX As Range

Set GolferX As ActiveCell

Sheets("INDEX").Select

Range("C10:C111").Find(GolferX).Select

ActiveCell.Offset(0, 5).Select

Call MoveOldRounds

ActiveCell.Offset(0, 19).Select

ActiveCell = Sheets("SCORECARD").Range("AV6").Value

Call IndexFormula

Sheets("SCORECARD").Select

Range("B4").Select

End Sub

The line in YELLOW above is where the code stops.

The desktop is using Office 365 Pro Plus and my laptop is using Office 365

Please please help.

Kind Regards,

Mono
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,457
Office Version
  1. 365
Platform
  1. Windows
Welcome to the Board!

Are you running the EXACT same file (with the exact same data) on both?
Are you getting an error message? If so, what does it say exactly?
Did you check your VBA References/Libraries on both machines, to ensure that the same ones are selected?
 

Monojono

New Member
Joined
Nov 20, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Welcome to the Board!

Are you running the EXACT same file (with the exact same data) on both?
Are you getting an error message? If so, what does it say exactly?
Did you check your VBA References/Libraries on both machines, to ensure that the same ones are selected?
Thanks for the Welcome on Board and your reply,

Yes exact same file with same data and checked believe I have checked the ref/lib but will check when back in the confirm but believe the same 4 options are selected.

If I remove all the code after whats highlighted in yellow and the .find(GolferX).Select from whats highlighted in yellow the code works and hightlighs/selects Range("C10:C111") which seem me point towards .find(GolferX).Select be the issue/problem
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,457
Office Version
  1. 365
Platform
  1. Windows
But are you getting some sort of error message?
And if so, what does it say?
 

Monojono

New Member
Joined
Nov 20, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

No error message, what happens is as follows:

1, run code
2, visual basic opens
3, visual basic highlights one line of the code in yellow (the same one i hightlighted in first post)
4, I have to press the stop button in visual basic
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,457
Office Version
  1. 365
Platform
  1. Windows
Do you have a "Break point" in your code?
It sounds like that is how it is behaving.

Note that I have seen, on occassion, a really fluky thing happen. I added a break point in my code for testing, and then I removed it. But for some reason, my code would continue stopping at that point, even though I had removed the break point. It was like it still had memory of it. I only had this happen once or twice, but it was frustrating.

The way I got around it was to totally delete that line of code, and then re-type it (so it is a new line of code that never had a break point in it). See if that fixes it for you.
 

Monojono

New Member
Joined
Nov 20, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Do you have a "Break point" in your code?
It sounds like that is how it is behaving.

Note that I have seen, on occassion, a really fluky thing happen. I added a break point in my code for testing, and then I removed it. But for some reason, my code would continue stopping at that point, even though I had removed the break point. It was like it still had memory of it. I only had this happen once or twice, but it was frustrating.

The way I got around it was to totally delete that line of code, and then re-type it (so it is a new line of code that never had a break point in it). See if that fixes it for you.
Thanks Joe, I will try now and post my result/finding

With ref to the ref/lib I have the following 4 selected on both machines:

1, visual basic for applications
2, microsoft excel 16.0 object library
3, OLE automation
4, microsoft office 16.0 object library
 

Monojono

New Member
Joined
Nov 20, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Do you have a "Break point" in your code?
It sounds like that is how it is behaving.

Note that I have seen, on occassion, a really fluky thing happen. I added a break point in my code for testing, and then I removed it. But for some reason, my code would continue stopping at that point, even though I had removed the break point. It was like it still had memory of it. I only had this happen once or twice, but it was frustrating.

The way I got around it was to totally delete that line of code, and then re-type it (so it is a new line of code that never had a break point in it). See if that fixes it for you.
Hi Joe,
Just deleted the line and saved, ran code with line removed, added line back in and saved, ran code again with line added.

Highlights same line again in yellow with a yellow arrow to the left of the line.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,457
Office Version
  1. 365
Platform
  1. Windows
Without a break point, I am not sure why it would stop without some sort of error message.
Have you disabled alerts/warnings anywhere in your code?

If it stops at that line, and lights up in yellow, what happens if you press the F8 key?

Lastly, what happens if you try compiling your VBA code before running it?
(From the VBA editor, go to the Debug menu and select "Compile VBAProject").
 

Monojono

New Member
Joined
Nov 20, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Without a break point, I am not sure why it would stop without some sort of error message.
Have you disabled alerts/warnings anywhere in your code?

If it stops at that line, and lights up in yellow, what happens if you press the F8 key?

Lastly, what happens if you try compiling your VBA code before running it?
(From the VBA editor, go to the Debug menu and select "Compile VBAProject").
The code is exact as shown in my first post

Tried to select Compile VBAProject but its greyed out and I can not select it
 

Watch MrExcel Video

Forum statistics

Threads
1,118,780
Messages
5,574,217
Members
412,577
Latest member
jamiedaka
Top