Synkronizer 10 has a new feature to load and save project files which for many 9.5 users means they will no longer need to write their own code.
For those that do need to process recurring, standardized and or complex comparisons synkronizer's functionality can be accessed
with Visual Basic for Applications (VBA).
YOU MUST HAVE A LICENSED DEVELOPER EDITION TO ACCESS SYNKRONIZER FUNCTIONS
To access the automation functionality of Synkronizer you must obtain a reference to the Application Object of the ComAddin. Then you will need the Application.ActiveProject to start working.
We've provided 2 simple "wrapper" functions to simplify you work which we'll also use in following examples.
1. | Ensure Synkronizer 10 Developer Edition is installed. |
2. | Start Excel |
3. | Open a (new) workbook |
4. | Open the VB Editor (Keyboard Shortcut Alt-F11) |
5. | Select your workbook in the Project Explorer window |
6. | Select menu Tools/References, scroll to 'Synkronizer 10.0 Object Library', check it, and press ok. |
7. | Select menu Insert/Module |
8. | Copy the following code: |
Function SynkApplication() As Synkronizer.Application
'Wrapper to retrieve the Application object
With Excel.Application.COMAddIns("Synkronizer.Connect")
'Ensure the addin is connected.
If Not .Connect Then .Connect = True
Set SynkApplication = .Object.Application
End With
'Display progress in Excel's status bar.
SynkApplication.DisplayStatus = True
End Function
Function SynkProject() As Synkronizer.Project
'Wrapper to retrieve the ActiveProject
If Not SynkApplication Is Nothing Then
Set SynkProject = SynkApplication.ActiveProject
End If
End Function
Note:
• | The programmatic identifier used for the ComAddin is "synkronizer.connect" |
• | The Synkronizer.Application is a child of the ComAddins(progid).Object |
• | When you attempt to access the application object with a Free or Professional edition, "Nothing" is returned and a messagebox is displayed. |