フィルターのクリア

Excel custom properties Add function - Invoke Error: Incorrect number of arguments

1 回表示 (過去 30 日間)
Grant
Grant 2014 年 2 月 10 日
回答済み: Chris Hooper 2019 年 7 月 3 日
Excel workbooks have a CustomDocumentProperties collection. This collection is of type DocumentProperties and these collection have an Add method.
If I call the invoke method on the collection I see :
workbook.CustomDocumentProperties.invoke
Item = handle Item(handle, Variant, int32)
Add = handle Add(handle, string, bool, int32, Variant(Optional))
I assume this means the Add method requires a string, bool, int32 and an optional variant and this matches with the Microsoft documentation for the Add method (<http://msdn.microsoft.com/en-us/library/office/ff862806.aspx)>.
However, all combination of inputs I've tried to this function result in the error:
Invoke Error: Incorrect number of arguments
except if I supply 7 or more arguments when I get the error:
Error: Invalid number is arguments. This method can take maximum 6 arguments
or if I supply anything other than a string as the first argument which results in the error:
No method 'Add' with matching signature found for class 'Interface.2DF8D04D_5BFA_101B_BDE5_00AA0044DE52'.
Has anyone successfully used this function to add a custom property to an Excel workbook from Matlab?
  1 件のコメント
Joel
Joel 2014 年 9 月 25 日
Did you ever find a solution to this issue? I've run into the same problem.
In addition, if I open an existing document that already has custom properties, I have an identical issue with the Item method. its also odd that it wants 2 parameters in addition to the handle since the documentation says it should be called with one parameter; either a string or a numerical index.

サインインしてコメントする。

回答 (1 件)

Chris Hooper
Chris Hooper 2019 年 7 月 3 日
I am very interested in this as well. I am trying to use optional arguments for the Range.Find() method in order to specify that I want an exact match (not a partial match). I cannot get any optional arguments to work, such as this:
fi_excelSheet.Cells.Find('a',[],[],'xlWhole',[],[],[],[],[]).value
I get the error:
Error using Interface.00020846_0000_0000_C000_000000000046/Find
Invoke Error, Dispatch Exception: Type mismatch.
Help!

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by