Community discussions

MikroTik App
 
ohilton576
just joined
Topic Author
Posts: 6
Joined: Sat Oct 20, 2018 10:17 pm

API for Microsoft VBA

Sun Mar 17, 2024 10:57 pm

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.
 
anovojr
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Wed Nov 15, 2017 9:24 am
Location: Philippines
Contact:

Re: API for Microsoft VBA

Tue Sep 17, 2024 7:47 pm

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.

Who is online

Users browsing this forum: No registered users and 2 guests