Automatically Starting Microsoft Excel Macros Through OLE
ID: Q98701
|
The information in this article applies to:
-
Microsoft FoxPro for Windows, versions 2.5, 2.5a
SUMMARY
Microsoft FoxPro for Windows can load and run a Microsoft Excel 4.0 macro
from a general field. The information below provides the steps for using
the Auto_Activate Microsoft Excel macro.
NOTE: These steps do not work with Excel versions greater than 4.0.
MORE INFORMATION
The Auto_Activate macro executes when a Microsoft Excel macro sheet is
activated.
To create this macro, do the following:
- Create a database in FoxPro with a general field.
- Open the general field in FoxPro, and choose Insert Object from
the Edit menu.
- From the Insert Object list, choose Microsoft Excel Macrosheet.
(Microsoft Excel must be a registered server application in order
for this option to be available.)
- In cell A1, type the following:
=ALERT("This is the Auto_Activate")
- In cell A2, type the following:
=RETURN()
- Select cell A1.
- From the Formula menu, choose Define Name. In the Name box, type
"Auto_Activate" (without the quotation marks).
- In the Macro section of the Define Name dialog box, select
Command.
- In the Refers To box, type "=$A$1" (without the quotation marks).
- In the Category box, make sure User Defined is selected.
- Choose Add and then choose OK.
- From the File menu, choose Exit, and choose Yes to update the
macro sheet.
When selected, this general field will now start Microsoft Excel and
run the Auto_Activate macro.
Additional query words:
FoxWin 2.50 Excel OLE DDE macrosheet
Keywords : FxinteropDde
Version : 2.50 2.50a
Platform : WINDOWS
Issue type :
Last Reviewed: August 8, 1999