This project has moved and is read-only. For the latest updates, please go here.

Excel Color Dialog COMException

Aug 7, 2011 at 12:42 PM

helow ...    i use vs 2010 win7x64. When i've  tried to see  the ColorDialog example i had COMException .   

Aug 7, 2011 at 1:04 PM

hey xidius,

do you have some lines of code for me?

sebastian

Aug 8, 2011 at 3:40 PM

ok Sebastian    i simple run your  Example6 - Dialogs.  I use { Office 2007 prof edition, vs 2010, win7x64).....  and  on  the  switch option with ColorDialog i have COM exception

next this switch lines :

 switch (radioSelectButton.Text)
            {
                case "xlDialogAddinManager":

                    returnValue = excelApplication.Dialogs[XlBuiltInDialog.xlDialogAddinManager].Show();
                    break;

                case "xlDialogFont":

                    returnValue = excelApplication.Dialogs[XlBuiltInDialog.xlDialogFont].Show();
                    break;

                case "xlDialogEditColor":

                    returnValue = excelApplication.Dialogs[XlBuiltInDialog.xlDialogEditColor].Show(); //// -----------it is throwing here
                    break;

Aug 8, 2011 at 4:07 PM

hello xidius,

yes now i see the ColorEditDialog needs one parameter.
found on: http://msdn.microsoft.com/en-us/library/aa221648(v=office.11).aspx

the following code looks not nice but works,

Dialog
dialog = excelApplication.Dialogs[XlBuiltInDialog.xlDialogEditColor];

returnValue = dialog.Show(1,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);

i do something to checkout optional parameter support without lost the SupportByLibrary information in a future release of NetOffice .
currently it is what is is :-/

Aug 16, 2011 at 4:53 PM

if you will find another variant please post here ok Sebastian   thanks

Aug 16, 2011 at 6:09 PM

hey xid,

Dialog dialog = excelApplication.Dialogs[XlBuiltInDialog.xlDialogEditColor];
object returnVakue = LateBindingApi.Core.Invoker.MethodReturn(dialog, "Show", new object[]{1});

is this a better way for you?