Can you give us a little background on what you are trying to achieve?
What this report will be used for? how many person will need to look at this report?
The PI Datalink Methods you are trying to use are not meant to be publicly available so this is not something I can help you with.
One alternative could be to use PI Web API from VBA.
Another one would be to use PI OLEDB Enterprise from Excel.
It requires the OLEDB Driver to be installed on the client, this adds an extra installation step each time you want someone to be able to consume your VBA code.
Below is an example with the OLEDB Provider Classic, you will need a different connection string ( strConnection ) to connect to PI OLEDB Enterprise.
Public Sub GetPIOLEDBData() Dim cn, rs As Object Dim strSql As String Dim strConnection As String Set cn = CreateObject("ADODB.Connection") strConnection = "Provider=PIOLEDB;Data Source=megatron;Time Zone=Server" strSql = "SELECT * from piarchive..pisnapshot where tag='sinusoid'" cn.Open strConnection Set rs = cn.Execute(strSql) Do Until rs.EOF Debug.Print rs!Tag, rs!Time, rs!value, rs!Status rs.MoveNext Loop rs.Close Set rs = Nothing cn.Close Set cn = Nothing End Sub
Please let us know,