I am creating a scheduled task script but when I try to use similar notation that I would to call an excel macro it doesn't work.
My objective is to have a display printed on a scheduled task.
See this message thread:
Printing a Process Book display on a scheduled basis, i.e. print a particular display at 6:00 AM?
Yes I saw this. Currently I am using a VBscript to open processbook display, then I print it, then I close processbook.
However I would like to call a macro from VBscript before printing. I could do it in the "display_open" but I'd really like to figure out how to call the macro from the VBscript
Can I ask why you are doing this? Most plants we work with are trying to get away from printing things (no offense to our Pulp and Paper customers), but why do you need something at a specific time like that?
Couple of reasons,
I've been asked to created an automated daily report. I want to use a processbook display and print it to PDF then send it out in an email and to the printer.
Managers want to have this report/print-out to bring to meetings.
As it is right now the processbook display is printed out every morning before meetings manually by each person with different timestamps and notes are jotted down on their print outs
There are lots of ways to do daily reports. This is not an approach I would take in 2019. With tools like AF analytics, Event frames, and Business Intelligence tools, the last choice I would pick is printing something out. I would certainly ask what kinds of notes are being written, what kinds of questions they ask in those meetings. I am a big advocate of being able to ask questions of the data in the meetings. You can't explore data on a static sheet of paper.
Are you licensed for PI Vision?
I can show you some things we have been doing for people that I think can make a morning meeting a lot more dynamic. I can only imagine that people ask questions about the data they see, and no one has the answer, so they go research it and either talk about it later or in one of the next meetings. I would find a way to try to get the data available to be sliced and diced in the meeting. Let me know if you want me to show you some ideas.
Going back and reading the thread for the link I posted, the directions are essentially: invoke ProcessBook and pass in the path to the ProcessBook file to be used.
When ProcessBook opens, there are various events that will automatically trigger, such as the Open event, DataUpdate events, etc.
If you want to have the VBA execute a specific macro which needs to be determined external to ProcessBook, you can have your batch process write something (macro name, indicator) to a text file before starting ProcessBook, then, in the Open event, read the contents of the file and call the appropriate macro.
While this can be done for the current need, as others have said, it may be advisable to ask management to look into alternate solutions with more current technology. It is my understanding that ProcessBook is a 'mature' product and will not be developed further.
Retrieving data ...