Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Examples of the work with applications excel

The application solves data write into the Excel application.

- This example is functional for the Web.
- Located in the tree of Pma objects: /Examples/Database/Excel


The Excel folder contains panel Panel1. The button script methods are located on the "Methods" tab of the PmaPanel object named "ExcelReadFromPm", "PmWriteToExcel" and "ReadDataFromDB". The particular xls files can be found in the application folder in Excel subfolder.
The three examples solve:
a) Open the Excel application followed by launching macro of this application (file: ExcelReadFromPmTemplate.xls).
In this example (ExcelReadFromPm designer's method) the AxGetObject method opens a file ExcelReadFromPmTemplate.xls and then a macro named "ReadFromXm" contained in the Excel application is launched by means of the "Application.Run" method. The macro contains a script, that is read via XMLDOM XML data offered by a Web server of the PROMOTIC application.
(The script is available after opening the file in the Excel environment by opening the Visual Basic language editor Alt+F11)
The disadvantage of this solution is the necessary decreasing of security level in the Excel environment allowing launching the macros.
b) Open the Excel application and write values into it (file: PmWriteToExcelTemplate.xls).
In this example (PmWriteToExcel designer's method) the AxGetObject method opens the PmWriteToExcelTemplate.xls file. This is followed by the script processing all the demanded operations.
The advantage of this solution is that the Excel file does not have to contain any macros.
The disadvantage is that when processing large data volumes into excel the writing is time consuming. This way the running of other parts of the PROMOTIC application can be limited.
c) Open the Excel application, read the data from database (file: ReadDataFromDB.xls, DBData.dbf, DBData.csv).
In this example (ReadDataFromDB designer's method) the Pm.ShellExecute method opens the ReadDataFromDB.xls file (this application is independent on the PROMOTIC system).
This application solves reading the data from a database of the dbf type or from CSV file.
(The script is available after opening the file in the Excel environment by opening the Visual Basic language editor Alt+F11)
Detailed example description Example of reading data from external databases in MsExcel
d) Reading the data into the PmgWTable object from a database (the DataExcel.xls file) by means of the PmaAdo object.
PROMOTIC 9.0.17 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice