Download presentation
Presentation is loading. Please wait.
1
DoD EA Dip Cse - NCW Export Macros
On the course CD in the directory for block 18 there is a file called ‘NCW Pivot Exports.mac’. Load this file as a macro into System Architect. Open the Macro in System Architect (ie alt F8) Note: there are 4 macro names, run one or more to see what happens. Use the Step into button for one macro to see what happens. Use the F8 key to continue stepping thru the code. Open one of the Macros using the Edit button. Note: this is the same as selecting VBA Editor from the Macro menu options. Examine the code for each of the modules. Note that there are 4 modules, each is used to export a particular set of attributes from a definition record. Text in the first line after the word ‘sub’ indicates the definition record that is being exported. You can run a macro from within the VBA editor using the ‘Run’ option on the tool bar or commands under the ‘Run’ menu. May 2006 DoD EA Dip Cse - NCW Export Macros
2
DoD EA Dip Cse - NCW Export Macros
Macro menu options. May 2006 DoD EA Dip Cse - NCW Export Macros
3
DoD EA Dip Cse - NCW Export Macros
The Reference utility is accessed from the Tools menu. The Run command on the tool bar or from the Run menu. May 2006 DoD EA Dip Cse - NCW Export Macros
4
LOAD & RUN A MACRO IN EXCEL
The macro may be provided as a text file. See the Macro text file ‘extract OpAct with Sys func one per row.txt’ in the block 18 dir on the course cd. Open this file in a text editor. Open Excel and create a new work book. Access the macro function via the tool menu. Check that security is set to medium or lower, you need this setting to be able to run macros. If you change this setting close and open Excel again to ensure the changes are set. Open the macro utility (VB editor), the shortcut key for this is alt F8. enter a name for the macro (no spaces allowed) and notice that the create button becomes active. Select create and you will be taken into the VB editor and a blank module will be presented. See the screen shot below for an example. Copy the macro text into the text editor Correct the Sub and End sub entries to match the ncw macro Check that the available References (VBA) is set to include SA The Reference utility is found under the Tools option Use F8 to step thru the macro one line at a time. Any syntax errors or invalid references will be highlighted. Use the ‘reset’ button on the tool bar or under the ‘Run’ menu item to stop the step thru processing. To run the macro use the ‘Run’ command on the tool bar on from the ‘Run’ menu or press the shortcut key F5. Note the lines “Set saoOpAct = appSA.Encyclopedia.GetFilteredDefinitions("*", 194)” the number 194 is the code used by SA to mean the function/activity definition. This code comes from defns.bas file which can be found in the System Architect program directory. If you create your own custom definitions be careful that you don’t change their user definition number in the usrprops.txt file or else your macro will stop working properly. Note: step thru the macro in the VB editor to see what it does, use the watch function to see values. Note: You can alternately export definitions into CSV format using the Export Defintion functionaliy in System Architect. The resulting csv may need to have superfluous columns deleted, column headings renamed etc before you do further manipulations. Using an export macro removes some of this extra steps but you need a new macro for each definition export. Note: You can use the Excel lookup utility to join up with data from other tables and or use the Pivot table function to do additional analysis. May 2006 DoD EA Dip Cse - NCW Export Macros
5
DoD EA Dip Cse - NCW Export Macros
May 2006 DoD EA Dip Cse - NCW Export Macros
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.