ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel's main windows does not redraw (https://www.excelbanter.com/excel-programming/325393-re-excels-main-windows-does-not-redraw.html)

Peter Huang [MSFT]

Excel's main windows does not redraw
 
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.


Mircea Pleteriu[_2_]

Excel's main windows does not redraw
 
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.




Mircea Pleteriu[_2_]

Excel's main windows does not redraw
 
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.




Peter Huang [MSFT]

Excel's main windows does not redraw
 
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.


Mircea Pleteriu[_2_]

Excel's main windows does not redraw
 
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.




Peter Huang [MSFT]

Excel's main windows does not redraw
 
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.


Mircea Pleteriu[_2_]

Excel's main windows does not redraw
 
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.




Mircea Pleteriu[_2_]

Excel's main windows does not redraw
 
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.




Peter Huang [MSFT]

Excel's main windows does not redraw
 
Hi

Thanks for your quickly reply!

If you still have any concern on this issue, 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.



All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com