Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I think in this scenario, we would better write a COM Addin to set the click call back function. Because when we automation Excel to tell the Excel to add a context menu item, while setting the call back function in the Winform's member function. Since Excel will try to call the event handler, while the event handler function is in another process. So I think you may try to write a COM Addin so that the event handler in the C# Com-Addin will be in the same process of Excel(The Addin assembly will be loaded into Excel process) Here is a sample add-in code for your reference. How To Build an Office COM Add-in by Using Visual C# .NET http://support.microsoft.com/?id=302901 Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Peter,
Does it work with MS Office 2002? The article points out that it works with Office XP/2003. My customer uses MS Office 2002. Initially I intended to build an MS Office System-Excel Workbook project supported by Office 2003 but unfortunately it's not supported by Office 2002. ""Peter Huang" [MSFT]" wrote in message ... Hi I think in this scenario, we would better write a COM Addin to set the click call back function. Because when we automation Excel to tell the Excel to add a context menu item, while setting the call back function in the Winform's member function. Since Excel will try to call the event handler, while the event handler function is in another process. So I think you may try to write a COM Addin so that the event handler in the C# Com-Addin will be in the same process of Excel(The Addin assembly will be loaded into Excel process) Here is a sample add-in code for your reference. How To Build an Office COM Add-in by Using Visual C# .NET http://support.microsoft.com/?id=302901 Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
One more mention. It's a must that this feature to be available only when the Excel gets opened by the Windows application (clicking the button on the only one form) and not more. ""Peter Huang" [MSFT]" wrote in message ... Hi I think in this scenario, we would better write a COM Addin to set the click call back function. Because when we automation Excel to tell the Excel to add a context menu item, while setting the call back function in the Winform's member function. Since Excel will try to call the event handler, while the event handler function is in another process. So I think you may try to write a COM Addin so that the event handler in the C# Com-Addin will be in the same process of Excel(The Addin assembly will be loaded into Excel process) Here is a sample add-in code for your reference. How To Build an Office COM Add-in by Using Visual C# .NET http://support.microsoft.com/?id=302901 Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mircea,
The COM Add-ins is available for office 2000,office XP(2002), office 2003. The office xp is the office 2002. There is a few difference between managed com add-in develop. Office 2000 use the IDE generated Interop assembly. Office XP use the Office XP PIA http://www.microsoft.com/downloads/d...61e-3060-4f71- a6b4-01feba508e52&displaylang=en Offic 2003's PIA is installed with office 2003 installation program. We need to build for every version indepently. Also the Office load the com addins depent on the registry key, we can change it before we start the Excel to control if we need the Excel to load the com addins now. e.g. we can set the loadbehavior key to 0, so that the com addin will not be loaded. Add-In Registration http://msdn.microsoft.com/library/de...us/vsintro7/ht ml/vxconadd-inregistration.asp Also for simplification, why not print the error in certain excel cell to notify the enduser? Can you describe the scenario more detailed so that we may try to see if there is other approach? Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Peter,
I have implemented an Office COM Add-in. Now the message box is displayed and Excel's main window repaints when the message box is moved. The last point to fix is that the new menu item has to be visible only if the Excel is opened from within the Windows app by pressing the button on the form. I think that it will work if the Windows app will set the loadbehavior key to 0 within the registry. One more question: I want to extend the windows form with a textbox control. The text entered by user must be displayed by the Add-in's message box. How could I send the text to the add-in? I'd like to avoid using the registry. Thank you for your helpful support, Mircea ""Peter Huang" [MSFT]" wrote in message ... Hi Mircea, The COM Add-ins is available for office 2000,office XP(2002), office 2003. The office xp is the office 2002. There is a few difference between managed com add-in develop. Office 2000 use the IDE generated Interop assembly. Office XP use the Office XP PIA http://www.microsoft.com/downloads/d...61e-3060-4f71- a6b4-01feba508e52&displaylang=en Offic 2003's PIA is installed with office 2003 installation program. We need to build for every version indepently. Also the Office load the com addins depent on the registry key, we can change it before we start the Excel to control if we need the Excel to load the com addins now. e.g. we can set the loadbehavior key to 0, so that the com addin will not be loaded. Add-In Registration http://msdn.microsoft.com/library/de...us/vsintro7/ht ml/vxconadd-inregistration.asp Also for simplification, why not print the error in certain excel cell to notify the enduser? Can you describe the scenario more detailed so that we may try to see if there is other approach? Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
This is related with InterProcess Communication(IPC). Although there are many IPC methods including the Remoting in .NET. But I think the easiest way is to store the value in certain excel cell(invisible), and the addin will read the cell's value to display. If you still have any concern, please feel free to post here. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Peter,
P've put the string to registry key then the add-in reads the value from registry when it gets loaded. I observed a strange behavior. If the registry key's value is written (by hand) before running the addin's setup the add-in is able to read the value and display the message box. If the value is written to registry (by hand) after installing the add-in but before opening Excel then opening Excel does not even load the add-in. ""Peter Huang" [MSFT]" wrote in message ... Hi This is related with InterProcess Communication(IPC). Although there are many IPC methods including the Remoting in .NET. But I think the easiest way is to store the value in certain excel cell(invisible), and the addin will read the cell's value to display. If you still have any concern, please feel free to post here. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please ignore the message before. It was a fault of me. Actually I thinks
it's a fault of the IDE. ""Peter Huang" [MSFT]" wrote in message ... Hi This is related with InterProcess Communication(IPC). Although there are many IPC methods including the Remoting in .NET. But I think the easiest way is to store the value in certain excel cell(invisible), and the addin will read the cell's value to display. If you still have any concern, please feel free to post here. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pls confirm 2007 chart redraw is up to 10 times slower than 2003 | Charts and Charting in Excel | |||
Excel does not redraw iteself | Excel Programming | |||
Redraw Application Window | Excel Programming | |||
How can you turn off screen Redraw | Excel Programming | |||
How can you turn off screen Redraw | Excel Programming |