You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the Item properteis in Excel VBA objects take parameters, believe it or not. The following additional method is proposed in ActiveXComponet to allow for this. Tested extensively.
/**
* Return a property with parameters.
* <p>
* This is required by some of the Excel VBA objects' Item properties.
*
* @param propertyName Property name
* @param args Arguments
* @return Dispatch representing the object under the property name
*/
public ActiveXComponent getPropertyAsComponent(String propertyName, Variant...args)
{
if (args == null || args.length == 0)
return getPropertyAsComponent(propertyName);
return new ActiveXComponent
(
Dispatch
.invoke
(
this,
propertyName,
Dispatch.Get,
args,
new int[args.length]
).getDispatch()
)
;
}
Example of usage, assuming we are in a Range class for the Excel VBA Range object, where Range extends ActiveXComponent:
public Range getCells(int row, int column)
{
return new Range(getPropertyAsComponent("Cells", new Variant(row), new Variant(column)));
}
The text was updated successfully, but these errors were encountered:
Some of the Item properteis in Excel VBA objects take parameters, believe it or not. The following additional method is proposed in ActiveXComponet to allow for this. Tested extensively.
Example of usage, assuming we are in a Range class for the Excel VBA Range object, where Range extends ActiveXComponent:
The text was updated successfully, but these errors were encountered: