VBA: Sudden "No value given for one or more required parameters" error in previously working code

perguimo

New Member
Joined
May 7, 2020
Messages
3
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hi, my first post so please bear with me. I'm not new to VBA but I have a problem for which I've been scratching my head for quite awhile. I have a long complex macro that reads data from several sources, mostly in a SQL server and in several SharePoint lists with ADO from different domains. This has been working for years now and just this week two of the SharePoint List connection give me the message "No value given for one or more required parameters.". I checked another two different SharePoint connections and they work fine. To troubleshoot the issue I modified the SQL statement to search where the errors might come from.

This SQL statement passes:
VBA Code:
SELECT * FROM Prj_Tracking_Roles

but this one doesn't:
VBA Code:
SELECT UserName FROM Prj_Tracking_Roles

The original SQL statement is a bit more complex but I think the two samples above gives the gist of the issue.

Some months ago I had a slight different issue and that was cause by a forced Microsoft patch on our company that created an error. A quick fix by Microsoft and another patch solved the issue. But I don't see on internet any reference to this on the last week. Have someone come across this issue and got a way to solve it?

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Just in case UserName is a system reserved word try the following as a quick test
select Prj_Tracking_Roles.UserName from Prj_Tracking_Roles
 
Upvote 0
Hi Jimrward,

The field 'Username' was working before so I would not expect this to make any different. Nevertheless I have tried and it also fails. It works for other two connections (different SharePoint lists) within the same macro.
 
Upvote 0
Well, I finally managed to solve it. It was not a coding error but rather a change on the field name in the two SharePoint lists. I'm not sure if done by our SharePoint server administrators or forced by a patch update recently but the fields 'Prj_Code' in one list and 'UserName' on the other got mysteriously changed to 'Title'. As I am the owner of those two lists I would never have thought that someone/something else would change them.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,472
Members
452,915
Latest member
hannnahheileen

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