User`s guide

Magic Square Examples
4-5
Build debug version = No
Show verbose output = No
Building the Project
From the Excel Builder graphical user interface click Add File .
Select the file
mymagic.m from the directory <matlab>\work\xlmagic and
click
Open.
Click
Build or select Excel/COM Files from the Build menu.
Adding the Excel Builder COM Function to Excel
Start Excel on your system.
Open the file
<matlab>\work\xlmagic\mymagic.xls.
Note If you receive an Excel prompt informing you that this file contains
macros, select the Enable Macros option to run this example.
Illustration 1. Output Magic Square Results to Excel
From the main Excel window (not the Visual Basic Editor), display the Macro
dialog either by selecting the
Alt and F8 keys at the same time or by selecting
the
Macros option from Tools -> Macro.
Select
mymagic from the list and click Run. This procedure returns a magic
square of size 4 beginning in cell B2.
Figure 4-3: Magic Square Returned to Excel Worksheet