필터 지우기
필터 지우기

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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by