Home All Groups Group Topic Archive Search About

How can I send 'Save' message to the excel main window?

Author
27 Nov 2006 4:15 AM
iloveprincess
Hi,

I'm developing windows application using VB.Net 2005.
I would like to send 'save' message using 'SendMessage' API to the excel
appication. I've already got a handle of the excel window with 'FindWindow'
API.
How can I send 'save' command to external excel window?

Actual thing I want to do is I can handle excel application in the winform.
My client hope that all staff can use excel application in new window
application.
So, I placed excel application to the panel control on the winform using
'SetParent' API.
But I've found that excel application's main window handle is changed after
placing in the winform. So, I couldn't do anything with original excel main
window handle.

Finally, I'm trying to find another way.
First way is that user click 'open' button on the window application to open
an excel file in the network folder, and start excel application, and user
update excel file on the external excel application, and then click 'save'
button on the window application to save external excel file, and click
'close' button on the window application to close external excel application.

So, I need to use 'SendMessage' API to save and close excel application.
How can I do?

Second way is using 'Process' namespace.
However, to use 'Process' I have to study more and more.
Can you help me?

Thank you for your time.

Author
27 Nov 2006 8:51 AM
Michel van den Berg
It isn't an answer to your question, but please have a look at VSTO:
http://msdn2.microsoft.com/en-us/library/d2tx7z6d(VS.80).aspx
As Excel is an Office product, you might want to use it...

iloveprincess schreef:

Show quoteHide quote
> Hi,
>
> I'm developing windows application using VB.Net 2005.
> I would like to send 'save' message using 'SendMessage' API to the excel
> appication. I've already got a handle of the excel window with 'FindWindow'
> API.
> How can I send 'save' command to external excel window?
>
> Actual thing I want to do is I can handle excel application in the winform.
> My client hope that all staff can use excel application in new window
> application.
> So, I placed excel application to the panel control on the winform using
> 'SetParent' API.
> But I've found that excel application's main window handle is changed after
> placing in the winform. So, I couldn't do anything with original excel main
> window handle.
>
> Finally, I'm trying to find another way.
> First way is that user click 'open' button on the window application to open
> an excel file in the network folder, and start excel application, and user
> update excel file on the external excel application, and then click 'save'
> button on the window application to save external excel file, and click
> 'close' button on the window application to close external excel application.
>
> So, I need to use 'SendMessage' API to save and close excel application.
> How can I do?
>
> Second way is using 'Process' namespace.
> However, to use 'Process' I have to study more and more.
> Can you help me?
>
> Thank you for your time.
Author
27 Nov 2006 9:27 AM
iloveprincess
Thank you for your reply.

I really appreciate.

Show quoteHide quote
"Michel van den Berg" wrote:

> It isn't an answer to your question, but please have a look at VSTO:
> http://msdn2.microsoft.com/en-us/library/d2tx7z6d(VS.80).aspx
> As Excel is an Office product, you might want to use it...
>
> iloveprincess schreef:
>
> > Hi,
> >
> > I'm developing windows application using VB.Net 2005.
> > I would like to send 'save' message using 'SendMessage' API to the excel
> > appication. I've already got a handle of the excel window with 'FindWindow'
> > API.
> > How can I send 'save' command to external excel window?
> >
> > Actual thing I want to do is I can handle excel application in the winform.
> > My client hope that all staff can use excel application in new window
> > application.
> > So, I placed excel application to the panel control on the winform using
> > 'SetParent' API.
> > But I've found that excel application's main window handle is changed after
> > placing in the winform. So, I couldn't do anything with original excel main
> > window handle.
> >
> > Finally, I'm trying to find another way.
> > First way is that user click 'open' button on the window application to open
> > an excel file in the network folder, and start excel application, and user
> > update excel file on the external excel application, and then click 'save'
> > button on the window application to save external excel file, and click
> > 'close' button on the window application to close external excel application.
> >
> > So, I need to use 'SendMessage' API to save and close excel application.
> > How can I do?
> >
> > Second way is using 'Process' namespace.
> > However, to use 'Process' I have to study more and more.
> > Can you help me?
> >
> > Thank you for your time.
>
>