I am not sure if this control is accessible through VBA but will find out.
I've received the following information for your question from a PI DataLink developer:
VBA interaction with DataLink is only supported with DataLink to access the Select and Resize options on the DataLink function context (right-click) menu. There is no way to access the task pane with VBA. See the support article for the supported VBA interactions.
Just an idea, don't know if this works: Aren't the custom taskpanes of any Excel add-in added to the CustomTaskPanes collection? Then finding the DL taskpane, grabbing a reference, and setting visible=false might work.
Worth giving it a try...
Good idea Roger. Chapeau!
It's possible to access the DataLink task pane by it's name. The following code however fails with an exception.
Private Sub CommandButton1_Click()
Application.CommandBars("Compressed Data").Visible = False
Run-time error '-2147467259 (80004005)': Method 'Visible' of object 'CommandBar' failed.
When researching the meaning of the error code, it mainly becomes translated as "Unspecified error" or "Unknown System error" but I believe in this case we can assume an "access denied".
Ah, bad luck! Probably the supplier has overridden this property / behaviour... ;-)
I was trying to get the CustomTaskPanes collection on the VBA, but it might be impossible...
Thanks for your help!
The way to access a DataLink task pane should be according to the snippet I've posted earlier but I assume that Roger is right and the Visible property is not publicly available in the current and likely as well in previous releases. You may want to request a corresponding enhancement. When doing so, please describe your use case as detailed as possible.
This thread is pretty old at this point, but I just handled a similar request from another customer.
The VBA to close the GUI panel is still not exposed, but this is a workaround that will work in some cases that lead to this (not sure if it applies to yours):
If the panel is opening because you've selected the array in VBA in order to use the resize function, then you should be able to oversize the array and it will never have to be resized, and never have to be selected in the first place.
Retrieving data ...