AnsweredAssumed Answered

ace manual recalc vbs

Question asked by benny on Jul 6, 2017
Latest reply on Jul 6, 2017 by benny

I would like to do a automated manual recalc over a certain periode for all ACE calculated tags. I do this now with a VB.NET program and this works fine on my PC but not on the target machine I would like it to run. (something to do with the used processor in this server)

I have found a vbs script that would be perfect but I can not get it to work.

'=====================================

'ACERecalc.vbs 
'VBScript utility that calls an ACE recalc 

Err.Clear 
Dim startTime 
Dim endTime 
Dim strCtxtPth 
Dim answer 
 
'strCtxtPth="\\MyLaptop\my_executable\my_Module
strCtxtPth="\\PIDBPRD\default"

startTime=InputBox("Enter start time: ") 
endTime=InputBox("Enter end time: ") 
 
On Error Resume Next 
Set piAceObj = CreateObject("PIACECommon.PIACEModuleDBFunctions") 
If Err.Number Then 
MsgBox "Error: " & Err.Description 
End If 

 

 
On Error Resume Next 
answer = piAceObj.AddManualRecalculation(strCtxtPth,cDbl(startTime),cDbl(endTime)) 
 
If Err.Number Then 
MsgBox "error: " & Err.Description 
End If

'========================================== 

The error says "can't make a Active-X object"

I think the problem is that the Ace namespaces are not imported.

Can someone help me getting this to run. Or maybe someone has a better script?

Outcomes