400 error - can't figure out why it is happening

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
275
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2011
Platform
  1. Windows
  2. MacOS
I made a macro-enabled workbook for my Dad, for keeping track of golf scores for a senior’s group he plays with.

I created it on Windows and he is using it on Windows.

He has two computers, a desktop and a laptop, and would like to be able to use the file on either of them.

He is receiving a 400 error on his desktop when pressing a certain button, but the same issue does not occur on his laptop. The issue also never occurred for me as I was creating & testing the file on my computer.

I was able to step through the code and figure out what line of code is causing the error. It is:
VBA Code:
.Range("T" & Row).Formula2 = FormulaToUse

(This line is within a WITH block, which is why it starts with a period.)

When the error occurs, the variable Row equals 7 and the variable FormulaToUse equals the following:
"=VLOOKUP(1,'Allen, Ed'!$A$3:$F$5000,5)"

There is definitely a worksheet named "Allen, Ed" in the file.

On my computer, I have the following version of Excel:
Microsoft Excel for Microsoft 365 MSO (Version 2210 Build 16.0.15726.20188) 32-bit

On his laptop, where the file is working fine, he has this version of Excel:
Microsoft Excel for Microsoft 365 MSO (Version 2210 Build 16.0.15726.20070) 64-bit

On his desktop, where the 400 error is occurring, he has this version of Excel:
Microsoft Excel 2019 MSO (Version 2210 Build 16.0.15726.20188) 64-bit

I had him try to update Excel on his desktop, but it said he already had the latest version, so that does not seem to be the problem.

I notice that his desktop does not have the Microsoft 365 version on it like the other two computers do, but I have no idea why that might make a difference.

Does anyone have any idea why this error is happening? I am at a loss.
 
There are some other options here

But I'd also try and setup a new workbook on Dads computer and copy data and macros across as required.
You could post ALL of the code in case there is another issue as well.
Thanks for posting this link. I will tell my Dad to try a couple of these things. Maybe doing a Repair of Excel will take care of it. Seems too good to be true, but we'll certainly try it. Also the Trusted Access thing might be the issue. Will check both and report back.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I was just able to take control of my Dad's computer and try some things. I turned on Trusted Access of VBA, but that didn't do it. Then I tried replacing all instances of "Formula2" with "Formula". That did it. I didn't get any 400 errors after that. I could have sworn I had tried that already (in one spot) and it had no affect. But it does now.

So, mystery solves. However, one thing I am not clear on. Why does the retail version of Excel 2019 not like Formula2? The Microsoft 365 version does, do I don't understand why it would be different in the retail version.
 
Upvote 0
Upvote 0
one thing I am not clear on. Why does the retail version of Excel 2019 not like Formula2? The Microsoft 365 version does, do I don't understand why it would be different in the retail version.
My understanding it that Formula2 only works if your version of Excel supports Dynamic Arrays which is MS365, Excel 2021 and later.
You can test this out by typing some data into A1 to A4 and then in B1 enter the formula =A1:A4
If it supports Dynamic arrays it will "Spill" and populate B1:B4 if not it will only return the value from A1.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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