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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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