How to open Function wizard in Calc?

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
oousersym
Posts: 8
Joined: Mon Aug 03, 2009 7:37 am

How to open Function wizard in Calc?

Post by oousersym »

I am using c#.net. I want to open the Function wizard on button click using the following code,

Public DispatchResultEvent OpenFunctionWizard(XComponentContext xComponentContext,XSpreadsheetDocument xSpreadsheetDocument , XSpreadsheet sheet)
{
XMultiComponentFactory m_MultiComponentFactory = xComponentContext.getServiceManager();
XDispatchHelper dispatcher = (XDispatchHelper)m_MultiComponentFactory.createInstanceWithContext("com.sun.star.frame.DispatchHelper",xComponentContext);
XFrame frame = ((XModel).xSpreadsheetDocument ).getCurrentController().getFrame();
XCellRange oRange=(XCellRange)sheet.getCellRangeByName("A1");

uno.Any result;
result = dispatcher.executeDispatch((XDispatchProvider)frame, ".uno:FunctionDialog", "", 0, null);

return (DispatchResultEvent)result.Value;
}

When i execute the code, it opens function wizard, but DispatchResultEvent (result) is always null. What is wrong in above code? Do i have to pass any ParameterValue in executeDispatch?
OpenOffice 3.1 on Windows Vista
oousersym
Posts: 8
Joined: Mon Aug 03, 2009 7:37 am

Re: How to open Function wizard in Calc?

Post by oousersym »

Anybody?
OpenOffice 3.1 on Windows Vista
User avatar
Villeroy
Volunteer
Posts: 31363
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to open Function wizard in Calc?

Post by Villeroy »

From the good ol' times (TM) on oooforum.org: Programming actions, where macro recorder and API fail
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply