So,
I'm playing around with creating a Task Pane dohicky in VBA. Please don't suggest other tools, for a myriad of reasons that I'm not at liberty to discuss, that's a non-starter.
I found this in the API examples: https://help.solidworks.com/2019/english/api/sldworksapi/add_buttons_to_task_pane_example_vb.htm
Unfortunately, it doesn't work.
In the class we have:
swTaskPane.SetButtonState(buttonIdx) = True
Which, firstly is the wrong syntax.
should be:swTaskPane.SetButtonState(buttonIdx, Enable) = True
Unfortunately, once I do that I get an error saying:
"Expected Function or variable."
Any thoughts on what the issue could be?
Is this a function of the fact that the Microsoft Calendar control has been deprecated long ago?
Thanks!
'Enable' is a variable used in the API Help, and needs to be declared and set - otherwise VBA doesn't know what to do with it.
Parameters
You could skip the declaration and just use the raw boolean value: