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

OSI PI: PISampDat via VBA Produces 'Resize to show all...'

$
0
0

Hello all, I've been looking around this forum and (RJK here in the UK) for a while but this is my first request for help.

 

For the past few years I have used PISampDat to retrieve a series of values for a set of tags (PI points). The start and end times are 1st April last year to 1st April this year (which themselves come from an external 'setup' workbook) and there are 48 values per day. Total of 17520 values per tag.

 

This took around 20 minutes to refresh each of my 18 workbooks so I started to automate the process with VBA. The final stage was to get rid of the PI formulas from the workbook and use PISampDat and have now got it down to around one minute to refresh.

result_range.Value = Application.Run("PISampDat", pi_point, Format(time_start, "General Date"), Format(time_end, "General Date"), interval, do_timestamps, pi_server))

which works OK apart from the "Resize to show all values" in the top row of each column.

 

I have tried to resolve this by varying the size of the results range (to try to match it to the extent of the retrieved values) and even making it a single cell range but always the "Resize..." text remains. Also tried working with only 10 values - still no luck!

 

Has anyone any ideas please.

 

PI DataLink 2010 4.2.1

Excfel 2010

Windows 7


Viewing all articles
Browse latest Browse all 1120

Trending Articles