Where can I find document for various Excel COM objects and functions that operate on them?

9 views (last 30 days)
I'm new to Matlab's COM interface with Excel. I read many examples that list commands similar to the ones below. As I understand, each of these functions returns a COM object (exl, exlFile, exlSheet1, respectively).
exl = actxserver('Excel.Application')
exlFile = exl.Workbooks.open(path,0,true)
exlSheet1 = exlFile.Sheets.Item('Sheet1')
There are also many functions that can operate on these objects: set(), invoke(), get(), delete(), quit()
Is there a document where I can find comprehensive description of these objects and the functions operating on them?

Answers (2)

Kevin Chng
Kevin Chng on 16 Oct 2018
  2 Comments
Wei-Kai Shih
Wei-Kai Shih on 16 Oct 2018
Thanks. But the link doesn't provide description of the properties of the objects. For example, in the code segment below, how does the input arguments in open(path, 0, true) affect its output? e.g. what does the argument "true" refer to? Are exlSheet1 and exlFileSheet1 identical objects? How about exl.ActiveSheet and exlFile.ActiveSheet? are they also identical? Is there a reference manual for these objects and their properties/methods/interfaces?
exl = actxserver('Excel.Application')
exlFile = exl.Workbooks.open(path,0,true)
exlSheet1 = exl.Sheets.Item('Sheet1')
exlFileSheet1 = exlFile.Sheets.Item('Sheet1')
Another example is in the line below: How does the input value to the method "End" affect its output value? Why do we need to call End() with input value of 4 in order to find the end of the column? A reference manual documenting how to use End() method would be very helpful. Where can I find one?
robj = exlSheet1.Columns.End(4)
Kevin Chng
Kevin Chng on 18 Oct 2018
Edited: Kevin Chng on 18 Oct 2018
Sorry for late reply,
Other than excel object link ( here), sometimes I will look for VBA language, then modify from there to MATLAB code for it. I used it to change colour of column, and bold of word.
However, I have no idea where to get proper documentation on it, hence,for me, it is always try and error for it.
No experience working with microsoft office product other than excel.

Sign in to comment.


Wei-Kai Shih
Wei-Kai Shih on 18 Oct 2018
I might have found answer to my own questions. There are references on Microsoft website to the Microsoft Office interop objects. For example, the "sheets" interface is documented at Sheets. But I don't know if all office interop objects can find identical counterpart among COM objects. And I don't know the relationship between Interop and COM. Are they different names for the same thing?

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!