API for Microsoft VBA

Hi, I have written a .net API for Microsoft Office (MsAccess VBA etc).
Everything works, and code is stable. but I am having problems with SET commands that require parameters.

e.g. This command will successfully change the system identity

Call objMikApi.Send(“/system/identity/set”, False)
Call objMikApi.Send(“=name=D337MRF5”, True)

But when I try to send a command that requires a parameter so that only one entry is changed (and not all of them), for instance the equivalent “/ip dhcp-server lease set block-access=yes [find address=192.168.5.133]”, it does not seem to work.

e.g. This command will return a “!done”, but does not block the dhcp lease

Call objMikApi.Send(“/ip/dhcp-server/lease/set”, False)
Call objMikApi.Send(“=block-access=yes”, False)
Call objMikApi.Send(“[find address=192.168.5.133]”, True)

I tried various syntax options that still returns “!done” but nothing works because the lease does not actually get blocked.

Call objMikApi.Send(“/ip/dhcp-server/lease/set”, False)
Call objMikApi.Send(“=block-access=yes”, False)
Call objMikApi.Send(“find=address=192.168.5.133”, True)

This returns “!done” but does not work either.

Call objMikApi.Send(“/ip/dhcp-server/lease/set”, False)
Call objMikApi.Send(“=block-access=yes”, False)
Call objMikApi.Send(“=address=192.168.5.133”, True)

Can someone possibly show me the correct syntax. Please. Struggling for days on this. Desperate.

I’ve had a similar experience where certain commands wouldn’t execute properly until I tweaked the parameters. In your case, it sounds like the API might be picky about how the parameters are structured or identified.

One thing that helped me was making sure I had the latest tools and software updates. Sometimes, even small differences in version can cause weird bugs. That’s where something like Nerdused could come in handy. They’ve got a good selection of Microsoft products and other software tools that might help you make sure your setup is running smoothly and compatible with what you’re trying to do.

Ok I found one problem (and a solution) to making changes. API calls to make conditional changes will only work if you use row ID as parameter. It will not accept any other fields. Below I can block a specific DHCP server lease, but I can’t use Address, Active Host Name or any other fields as parameters, only row ID. I hope this makes things more clear.

Call objMikApi.Send(“/ip/dhcp-server/lease/set”, False)
Call objMikApi.Send(“=.id=*1”, False)
Call objMikApi.Send(“=block-access=yes”, True)