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:

  1. Assessing the environment using the OEAT
  2. 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.

  1. Create a shared folder named OEAT
  2. Open Windows Explorer and navigate to %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter
  3. Right click the folder and click Properties then switch to the Sharing tab
  4. Click Advanced Sharing on the Sharing tab
  5. Check the Share this folder checkbox and name the share OEAT

Figure 1

Create Network Share

  1. Click Permissions and verify that Everyone has Full Control of the share then click OK
  2. Click OK to close the Properties window
  1. Create the settings file that will be used to configure each scanning process
  2. Navigate to \\demo2010a\OEAT in Windows Explorer and run OEAT-Release.exe

Figure 2

OEAT Startup

  1. Click the Run Wizard button to start the configuration process and click Next to move to the first step
  2. The tool will notify you of which areas will be scanned. Click Next to move to the next step

Figure 3

Automatic Scan Actions

  1. 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

  1. 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

  1. Click Finish to create the settings file
  2. Click Exit to close the OEAT tool
  1. Create a batch file that will run the scan
  2. In \\demo2010a\OEAT create a new file named scan.bat
  3. 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.

  1. 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.

  1. Compile the results using the OEAT tool
  2. Navigate to \\demo2010a\OEAT in Windows Explorer and execute OEAT-Release.exe
  3. Click the Compile Results button to aggregate the results of all scans

Figure 6

Compile Results

  1. Review the results of the compilation
  2. Locate the OEAT Report.xlsx file that was opened when the compile completed
  3. 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.

  1. Install the Compatibility Inspector tool using the OCCI-Release.exe installer in the %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility folder
  2. Double click the msi file to start the installer.
  3. On the first page, click Next.
  4. Verify the Add-in for Office and Add-in for Visual Studio are both checked then click Next.

Figure 8

Code Compatibility Inspector Install

  1. Leave the install path as default and click Next twice to start the installation
  2. Once the installation is completed, click Close.
  1. OpenDemo File.ppt in and verify the Inspection add-in is ready to run
  2. Open Demo File.ppt in %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter
  3. Right click the ribbon and select Customize the Ribbon
  4. 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

  1. Close the PowerPoint Options dialog by clicking OK
  1. Run the compatibility inspection process on the slide deck
  2. Switch to the Developer tab in the ribbon and click the Inspect VBA Code button

Figure 10

Inspect VBA Code

  1. 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.

  1. When the process has completed, a summary of the results is displayed

Figure 12

VBA Inspection Summary

  1. Click OK on the summary to move on to saving the summary report. Click Save to save at the default location
  2. The complete list of all suggestions is stored in the text file

Figure 13

VBA Inspection Details

  1. Review the suggestions made by the compatibility inspector tool
  2. Switch to the Developer tab in the ribbon and click the Visual Basic button
  3. In Microsoft Visual Basic for Applications, open the clsPPTEvents file using the tree view on the left

Figure 14

Opening clsPPTEvents

  1. Comments have been added to the code to provide suggestions

Figure 15

VBA Inspection Comments

  1. Cleanup the comments added by the inspection tool
  2. Switch to the Developer tab in the ribbon and click the Remove Comments button
  3. 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.

  1. Open the sample Excel2007AddIn project
  2. Open Visual Studio 2010
  3. The solution located in %Office2010DeveloperTrainingKitPath%\Labs\AppCompatibility\Source\Starter\Excel2007AddIn\StarterExcel2007AddIn.sln
  4. Inspect the Office AddIn project
  5. Click Tools -> Inspect VSTO Code to start the inspection process

Figure 17

Inspect Visual Studio Add-In

  1. In the Inspect Visual Studio Project dialog, make sure all checkboxes are checked except Backup and click Inspect

Figure 18

Visual Studio Inspection Options

  1. 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

  1. Click OK on the summary to move on to saving the summary report. Click Save to save at the default location
  2. The complete list of all suggestions is stored in the text file

Figure 20

Visual Studio Inspection Details

  1. Review the changes made by the inspection tool
  2. Using the Solution Explorer, open Ribbon.cs
  3. Locate the DisplayScripts and PrintActiveWorkbook functions and verify they have comments added to identify potential problems

Figure 21

Visual Studio Inspection Comments

  1. Cleanup the comments added by the inspection tool
  2. Click Tools -> Remove VSTO Inspector Comments

Figure 22

Remove Visual Studio Inspection Comments

  1. In the dialog box, click Yes to start the removal process
  2. 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.