Hands-On Lab
Lab 11: Application Compatibility
Lab version:1.0.0
Last updated:10/26/2018
Contents
Overview
Exercise 1: Assessing the environment using the OEAT
Task 1 – Create the settings file
Task 2 – Compile the results
Exercise 2: Using the Office 2010 Compatibility Inspector Tool
Task 1 – Analyze a VBA Application
Task 2 – Analyze a Office Addin in Visual Studio 2010
Summary
Overview
In these lab exercises, you will use the Office compatibility tools to evaluate the current environment and existing Office Add-in code. Using these tools will help identify potential problems in Office Add-ins and suggest solutions.
Objectives
In this lab you will:
- Use the Office Environment Assessment Tool to scan the network
- Learn to use the VBA scanner to scan existing VBA applications
- Learn to use the Visual Studio Code scanner to scan existing Office Add-ins
System Requirements
You must have the following items to complete this lab:
- Microsoft® Windows® Vista SP1 or Microsoft® Windows Server 2008 (64-bit)
- Microsoft® Office Professional Plus 2010 (32-bit or 64-bit)
- Microsoft® Visual Studio 2010
Exercises
This Hands-On Lab is comprised of the following exercises:
- Assessing the environment using the OEAT
- Using the Office 2010 Compatibility Inspector Tool
Estimated time to complete this lab: 30minutes.
Starting Materials
This Hands-On Lab includes the following starting materials.
- Sample Documents and Add-Ins. The lab provides the following sample files and addins to inspect using the application compatibility tools.
◦%Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter\Demo File.ppt: This is a PowerPoint presentation containing VBA Code.
◦%Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter\Excel2007AddIn: This is a sample Excel Add-in project for Excel 2007.
Exercise 1: Assessing the environment using the OEAT
In this exercise you will assess the current Office environment to establish the current addins that are installed and come up with a plan for the Office 2010 migration.
Task 1–Create the settings file
In this first task you will configure the OEAT tool to be run on all the machines in your network.
- Create a shared folder named OEAT
- Open Windows Explorer and navigate to %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter
- Right click the folder and click Properties then switch to the Sharing tab
- Click Advanced Sharing on the Sharing tab
- Check the Share this folder checkbox and name the share OEAT
Figure 1
Create Network Share
- Click Permissions and verify that Everyone has Full Control of the share then click OK
- Click OK to close the Properties window
- Create the settings file that will be used to configure each scanning process
- Navigate to \\demo2010a\OEAT in Windows Explorer and run OEAT-Release.exe
Figure 2
OEAT Startup
- Click the Run Wizard button to start the configuration process and click Next to move to the first step
- The tool will notify you of which areas will be scanned. Click Next to move to the next step
Figure 3
Automatic Scan Actions
- Select the No option to not run a passive scan and make sure the Run hidden check box is cleared then click Next
Figure 4
Configure Passive Scan Options
- Set the Path to \\demo2010a\OEAT to define where the results of each scan are stored and click Next
Figure 5
Setup Scan Output Path
- Click Finish to create the settings file
- Click Exit to close the OEAT tool
- Create a batch file that will run the scan
- In \\demo2010a\OEAT create a new file named scan.bat
- Enter the following script into the batch file
CMD
\\demo2010a\OEAT\OEAT-Release.exe -scan
Note: This batch file will run the process from any machine with access to the network share. This batch file can be run as part of a start up script or manually on each machine. Make sure the account running the batch file has read and write access to the network share to allow storage of the scan results.
- Double click scan.bat to start the scan of the local machine
Note: When the scan is complete, a new xml will be placed into the folder containing the results of the scan
Task 2 – Compile the results
Once the data files are retrieved from each machine on the network, the results will be compiled into a results Excel workbook.
- Compile the results using the OEAT tool
- Navigate to \\demo2010a\OEAT in Windows Explorer and execute OEAT-Release.exe
- Click the Compile Results button to aggregate the results of all scans
Figure 6
Compile Results
- Review the results of the compilation
- Locate the OEAT Report.xlsx file that was opened when the compile completed
- View the AllInstalledAddins and AddinsNotShippedWithOffice sheets to see a summary of installed add-ins
Figure 7
Compiled Results
Exercise 2: Using the Office 2010 Compatibility Inspector Tool
In this exercise you will use the Compatibility Inspector Tool to update VBA and .NET code to Office 2010. First you will inspect a Power Point slide deck using the inspector Office Add-in to identify potential problems and then repair them. Next you will perform the same process on an .NET Add-in using Visual Studio 2010.
Task 1 – Analyze a VBA Application
In this task, you will inspect an existing Power Point deck to check its VBA code for compatibility with Office 2010.
- Install the Compatibility Inspector tool using the OCCI-Release.exe installer in the %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility folder
- Double click the msi file to start the installer.
- On the first page, click Next.
- Verify the Add-in for Office and Add-in for Visual Studio are both checked then click Next.
Figure 8
Code Compatibility Inspector Install
- Leave the install path as default and click Next twice to start the installation
- Once the installation is completed, click Close.
- OpenDemo File.ppt in and verify the Inspection add-in is ready to run
- Open Demo File.ppt in %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter
- Right click the ribbon and select Customize the Ribbon
- In the PowerPoint Options UI, locate the Developer ribbon in the right hand list and verify its checkbox is checked.
Figure 9
Customize the Ribbon
- Close the PowerPoint Options dialog by clicking OK
- Run the compatibility inspection process on the slide deck
- Switch to the Developer tab in the ribbon and click the Inspect VBA Code button
Figure 10
Inspect VBA Code
- In the Inspect VBA Project dialog, verify all checkboxes are checked and click Inspect
Figure 11
VBA Inspection Options
Note: If a warning appears relating to programmatic access to the VBA project follow the instructions to enable access to the object model and repeat the step.
- When the process has completed, a summary of the results is displayed
Figure 12
VBA Inspection Summary
- Click OK on the summary to move on to saving the summary report. Click Save to save at the default location
- The complete list of all suggestions is stored in the text file
Figure 13
VBA Inspection Details
- Review the suggestions made by the compatibility inspector tool
- Switch to the Developer tab in the ribbon and click the Visual Basic button
- In Microsoft Visual Basic for Applications, open the clsPPTEvents file using the tree view on the left
Figure 14
Opening clsPPTEvents
- Comments have been added to the code to provide suggestions
Figure 15
VBA Inspection Comments
- Cleanup the comments added by the inspection tool
- Switch to the Developer tab in the ribbon and click the Remove Comments button
- Open the VBA code window and verify the inspection comments have been removed
Figure 16
VBA Comments Removed
Task 2 – Analyze a Office Addin in Visual Studio 2010
In this task, you will connect the List web part to the InfoPath web part. This connection will allow the InfoPath form to display the details of the customer selected in the List web part.
- Open the sample Excel2007AddIn project
- Open Visual Studio 2010
- The solution located in %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter\Excel2007AddIn\StarterExcel2007AddIn.sln
- Inspect the Office AddIn project
- Click Tools -> Inspect VSTO Code to start the inspection process
Figure 17
Inspect Visual Studio Add-In
- In the Inspect Visual Studio Project dialog, make sure all checkboxes are checked except Backup and click Inspect
Figure 18
Visual Studio Inspection Options
- When the process is completed, a summary of the inspection is displayed. Click OK when you’re done reviewing it
Figure 19
Visual Studio Inspection Summary
- Click OK on the summary to move on to saving the summary report. Click Save to save at the default location
- The complete list of all suggestions is stored in the text file
Figure 20
Visual Studio Inspection Details
- Review the changes made by the inspection tool
- Using the Solution Explorer, open Ribbon.cs
- Locate the DisplayScripts and PrintActiveWorkbook functions and verify they have comments added to identify potential problems
Figure 21
Visual Studio Inspection Comments
- Cleanup the comments added by the inspection tool
- Click Tools -> Remove VSTO Inspector Comments
Figure 22
Remove Visual Studio Inspection Comments
- In the dialog box, click Yes to start the removal process
- Verify the comments in Ribbon.cs have been removed
Figure 23
Visual Studio Inspection Comments Removed
Summary
In this exercise you learned how to use the Application Compatibility tools provided with Office 2010 to analyze add-in installed within and environment and identify potential migration issues. Using this information the migration process from earlier versions of Office to Office 2010 can be better planned. In the event migration of custom Add-ins or VBA is needed, the Compatibility Inspector tools can perform an analysis of the code and suggest potential issues.