KB-55769: Opening, closing, and saving Excel spreadsheets via scripts.

Question:

When using Elipse SCADA, can Excel files be opened, saved, and closed via scripts?

Solution:

Yes; this is possible via ShellExecute function, which is found in the Global Manager via AppBrowser.

To open the spreadsheet:
ShellExecute(“open”, “Book1.xls”, “”, “”,1 )

To save the spreadsheet:
DDEExecute(“Excel”,”Sheet1″,”[SAVE()]”)

To close only the spreadsheet:
DDEExecute(“Excel”,”Sheet1″,”[CLOSE()]”)

To finish the process, just execute a program that closes this open program via a command line, and with this you will be able to use Elipse SCADA’s Execute command.

Example:
Execute(“C:\PSTools\pskill -t EXCEL.exe”)

In this example, we used the software PsKill, a Microsoft sysinternals’ tool.

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *