PDA

View Full Version : Solved: How to check if user has PI tag addin if not add it?



Simon Lloyd
11-19-2009, 04:08 AM
Hi all,
I'm working on a project to automate some data collection, one portion of which opens a workbook that gets all its data from PI tags which are refreshed when you change a date and and F9, thats all well and good if you have the PI add-in already installed if not you dont get any data.

How can i check if the user already has the PI add-in if not add it using VBA?

Bob Phillips
11-19-2009, 04:33 AM
You can check the addins collection to see if any are installed or not.


Dim addn As AddIn

For Each addn In Application.AddIns

If addn.Name Like "*PI*" Then

MsgBox addn.Name & " installed? " & addn.Installed
End If
Next addn

Simon Lloyd
11-19-2009, 08:03 AM
Thanks for that Bob, it proved one thing, the add-in although showing PI-Datalink is not called PI as the code didn't produce any results, however scrolling through it was found to be pipc32.xll, at least now i can test for it and close excel if its not present!