Creating custom dialog box in Excel COM add-in using C++

M

Mousam

Hi All,
I am developing an Excel COM Add-in using C++. I want to create a
custom dialog box similar to the dialog box for "SUM" function. "SUM"
function dialog box has two text boxes but my dialog box should have
three text boxes.

I have gone through the "Dialogs" object of Excel but it only provides
method to show the existing dialog boxes, it does not provide any way
to add a custom dialog box.

Can any one please tell me how to add a custom dialog box from an
Excel COM add-in using C++?
Any help would be greatly appreciated.

Thanks & Regards,
Mousam Dubey.
 
S

Scott McPhillips [MVP]

Mousam said:
Hi All,
I am developing an Excel COM Add-in using C++. I want to create a
custom dialog box similar to the dialog box for "SUM" function. "SUM"
function dialog box has two text boxes but my dialog box should have
three text boxes.

I have gone through the "Dialogs" object of Excel but it only provides
method to show the existing dialog boxes, it does not provide any way
to add a custom dialog box.

Can any one please tell me how to add a custom dialog box from an
Excel COM add-in using C++?
Any help would be greatly appreciated.

Thanks & Regards,
Mousam Dubey.

ATL will do this nicely, or you could create a dialog using Win32 APIs.
With ATL you would derive a class from CAxDialogImpl using the New
Object wizard, and call its Create or DoModal methods.
 
M

Mousam

ATL will do this nicely, or you could create a dialog using Win32 APIs.
With ATL you would derive a class from CAxDialogImpl using the New
Object wizard, and call its Create or DoModal methods.

Hi Scott,
Thanks for the reply.

Unfortunately this is not what I am looking for. Let me explain
problem more specifically.

Actually I want to have "Reference edit boxes" in my Dialog. In
"Reference edit box" user can either enter range references manually
or he/she can enter range reference by selecting specific cell.

I can not use "InputBox" function of "Application" object as I want to
have more than one "Reference Edit Boxes" in my Dialog.

I also looked at "ExecuteExcel4Macro" function of "Application" object
to run XLM macro "Dialog.Box" but unfortunately didn't get any success
so far. I am not able to pass Dialog structure (multidimensional
array) to "Dialog.Box" macro. I am getting "formula you typed contains
an error" error.


Can any one please help me with this?

Thanks & Regards,
Mousam Dubey
 
S

Scott McPhillips [MVP]

Mousam said:
Unfortunately this is not what I am looking for. Let me explain
problem more specifically.

Actually I want to have "Reference edit boxes" in my Dialog. In
"Reference edit box" user can either enter range references manually
or he/she can enter range reference by selecting specific cell.
I can not use "InputBox" function of "Application" object as I want to
have more than one "Reference Edit Boxes" in my Dialog.

I also looked at "ExecuteExcel4Macro" function of "Application" object
to run XLM macro "Dialog.Box" but unfortunately didn't get any success
so far. I am not able to pass Dialog structure (multidimensional
array) to "Dialog.Box" macro. I am getting "formula you typed contains
an error" error.

Well, one of us is confused. It does not matter what you want in your
dialog. You can use Win32 or ATL to create any dialog box that you can
imagine. Your COM addin can display it in Excel.

This has nothing to do with functions or dialogs provided by Excel: You can
use all Win32 functions and all Win32 controls in your dialog.
 
M

Mousam

Well, one of us is confused. It does not matter what you want in your
dialog. You can use Win32 or ATL to create any dialog box that you can
imagine. Your COM addin can display it in Excel.

This has nothing to do with functions or dialogs provided by Excel: You can
use all Win32 functions and all Win32 controls in your dialog.

Hi Scott,
I got your point, but my problem is I want to have "RefEdit
(Reference edit box)" control in my dialog but "RefEdit" control is a
special kind of active X control which is designed to work only when
placed on a form in an Excel VBA project. While I am creating an Excel
COM Add-in using C++ and therefore I am not able to use "RefEdit"
control in my dialog. More details can be read at http://support.microsoft.com/kb/q281542.

Therefore I am looking for some workaround for this issue.

Thanks & Regards,
Mousam Dubey.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top