Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

DataLink Sampled Data in VBA

$
0
0

Hi,

 

I am trying to use the PI Excel Addin functions in VBA.

This function gives me a value, but not the right one(41836.51). The PISampData should be returning a timestamp and either open/close for the breaker tag I have selected.

However, when I try to use the function on just the worksheet, I get the expected output. (16-jul-14 12:18:54 CLOSE)

Please tell me what could be wrong.

Below is my VBA Code.

 

Sub cals()

Dim ranker As Range

Set ranker = Range("K8:L8")

Cells(1, 1).Value = "25THST  .25TH ST 4KV BNK BKR     .SV"

Cells(1, 2).Value = "14-jul-2014"

Cells(1, 3).Value = "15-jul-2014"

Cells(1, 4).Value = "1h"

Cells(1, 5).Value = "msdmzhis1"

ranker.Formula = "=PISampDat($A$1,$B$1,$C$1,$D$1,1,$E$5)"

 

End Sub


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>