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
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
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?
 
Upvote 0
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
 
Upvote 0
But are you getting some sort of error message?
And if so, what does it say?
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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").
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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