Macro not working on other PCs

Alualy92

New Member
Joined
Jan 19, 2017
Messages
6
Hello,

My Macro is a very simple paste tool, including the unlocking of a sheet, content clearing, pasting data saved to the clipboard and then re-locking it. This works very well on my PC but it won't work on anyone elses when I send it to them to test. My code is:

Sub Paste3()
Application.ScreenUpdating = False
Sheets("Paste").Select
ActiveSheet.Unprotect Password:="XXXX"
Range("B3:G100000").ClearContents
Range("B3").PasteSpecial
ActiveSheet.Protect Password:="XXXX"
Application.ScreenUpdating = True
Sheets("Results").Select

End Sub

On other PCs, it usually gets to the paste part which is where it doesn't like it.

Thanks in advance.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What are you actually copying/pasting?
 
Upvote 0
Note that older version of Excel (and any "xls") files only allow up to 65536 rows. So you row references of 100000 are too big for that.
 
Upvote 0
Hi,

I'm pasting in data taken from a system we use at work. This is in an Excel format and manually pasting in the data works perfectly. The macro isn't a necessity but it would be nice to have and would make things fool proof.
 
Upvote 0
Okay thanks for this information. 100,000 was used to cover the range but this was set to too many rows anyway.
 
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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