Error 400 randomly

zsnemeth

New Member
Joined
Mar 4, 2015
Messages
36
Hi All,

I am not going to paste any codes here, because my question is just in general.
There is a VBA code, which is able to open all the Excel workbooks in a specified folder, copy their content from a specified range, and paste them all together in a big list.
Files, forms, shapes, even the colors are the same in all the 105 pieces, and the "main" file is similar too.

Question:
The code works perfectly on my computer, works at one of the collegues fine, but the other collegue has trouble with it.

He tries to execute the code and it sometimes runs until the end, but sometimes shows the Error message 400.
Weird is, that for the first time it stops after the 19th file, for the second time after the 63th, and for the third time after the 31th, and so on... so completely randomly.

Does anyone have any idea where is the error to search for?
Is there anything, what can cause this issue, or some settings what we can check?
Can it be because of the version of the Excel (he uses 2016, we do 2010)?

Any help would be greatly appreciated!

Thank you!

Cheers,
Zsolt from Hungary
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Files are in use? Then become available on subsequent runs?


According to another website regarding Error 400

Add an Error trap to find out what the Error description is, (if it can tell you that is)
Add this as the first row of code after the Dim
On Error GoTo Errorcatch

and at the end of the code put

exit sub

Errorcatch:
MsgBox Err.Description
 
Upvote 0
Hi,

thanks for the idea, it was good, but unfortunately it did not take me closer to the solution.
There were 2 different messages:
1) PasteSpecial Methode
2) Application Error
Everything was the same, all the files, all the other circumstances.
And after those 2 messages it run through without any problems.

Weird.

I believe it must be the Windows System and/or the Office version somehow.

Thanks!

Cheers,
Zs
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,582
Members
449,089
Latest member
Motoracer88

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