INFO: Behavior of GETOBJECT() with Excel and Word for Windows

ID: Q128994


The information in this article applies to:


SUMMARY

This article describes how the behavior of the GETOBJECT() function is dependent on the OLE Server that processes the request. It focuses on the differences between Excel and WordBasic as OLE automation servers.


MORE INFORMATION

OLE and OLE automation are two primary means of sharing information. As an OLE client, Visual FoxPro can control external data from other applications. As OLE automation servers, Microsoft Word (through WordBasic) and Excel support incoming OLE requests. Because OLE is still evolving, OLE automation servers do not support all requests the same way. For example, Word for Windows, version 6.0c and Excel version 5.0 do not identically support the request made by the GETOBJECT() function.

The GETOBJECT() function retrieves an OLE Automation object and creates a reference to that object. It has two arguments, a file name and a class name.

For example, to retrieve and create a reference to an Excel spreadsheet, you can use this syntax:


  cBudget=GETOBJECT('C:\Excel\Mysheet.XLS ','Excel.Application') 
Passing an empty string as the first argument to the GETOBJECT() function results in different behaviors with Excel version 5.0 or Word as OLE automation servers:


REFERENCES

For a list of OLE automation verbs supported by Excel version 5.0, please see the Excel Object Browser.

For a list of WordBasic OLE automation verbs, please see the "Using Word Basic" guide.

For more information about Microsoft OLE automation servers, please see the Office Developer's Kit.

Additional query words:


Keywords          : kbinterop kbAutomation kbVFp300 kbVFp600 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: August 2, 1999