When you're in the Visual Basic Editor, you can see that a small portion of the macros are located in these "Microsoft Excel objects":
- ThisWorkbook ( ThisWorkbook.cls )
- Sheet1 (RADNA) ( Sheet1.cls )
Most macros are located in "Modules":
3. Module1 ( Module1.bas )
' CTRL-w
-
Open your task in the work orders application
After that: (Select All: CTRL-a), (Copy: CTRL-c) -
Activate the "RADNA" sheet (click anywhere in "RADNA")
-
Run this macro (No_01_wwms_W): CTRL-w
==>
The macro will paste into "WWMS" Excel sheet, and after processing, paste the data we need into "RADNA" sheet.
' CTRL + l (lowercase letter L)
The macro copies the line we need from the "MPLS" sheet (list of devices) to the "RADNA" sheet.
' CTRL + t
The macro opens the correct sheet (according to the device name) in the Excel file on the network drive.
' CTRL + SHIFT + t
The macro copies some data from the "RADNA" sheet to an already open Excel file on the network drive.
' CTRL + p
sFile = "Pokreni_inventory_01_port.bat"
x1 = Shell(sPath + sFile + " " + sUR_ID + " " + sSlot + " " + Chr(34) & sDescription & Chr(34), vbNormalFocus)
The macro runs my Java utility Inventory_01_port using "Pokreni_inventory_01_port.bat".
Pokreni_inventory_01_port.bat:
set EQUIPMENT=%1
set SLOT=%2
set DESCRIPTION=%3
:: Change Current Directory to the location of this batch file
:: http://ss64.com/nt/cd.html
CD /d "%~dp0"
CMD /c %JAVA_HOME%bin\java -cp Inventory_01_port-1.0-SNAPSHOT.jar;dependency204/* com.mxb.inventory.port.Inventory_01_port %EQUIPMENT% %SLOT% %DESCRIPTION%
To make it easier to work with the Ericsson Adaptive Inventory (formerly Ericsson’s Granite Inventory) application, I use my 3 Java utilities below every day.
My utilities Inventory_01_port,
Inventory_02_ui, and
Inventory_03_access
use the SikuliX Java library.
Open this file and read more about SikuliX:
Inventory_01_port.java
https://github.com/RaiMan/SikuliX1
It uses image recognition powered by OpenCV to identify GUI components and can act on them with mouse and keyboard actions.
For use in Java Maven projects the dependency coordinates are:
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>2.0.5</version>
</dependency>
I use the SikuliX library because the Inventory application I use runs through a Citrix server (Citrix server -there is no easy access to a GUI's internals).
CTRL + d (docx)
Here vba ScriptingDictionary is used.
- First you need to open your Word template.
- This Excel macro in the Word template replaces keywords ( #words ) with data from "RADNA" (They are loaded into "ScriptingDictionary". ).
' CTRL + r
The macro opens an Excel file on the network drive, then searches for the last row in the table, and copies the data from "MP_REPORT" to the next, empty, row.
' CTRL + m
Macro sends INFO mail.
The data is in "RADNA" and "POPISI".
' CTRL + n
The macro creates new folders, and copies some Excel and Word files into them.