Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Close excel application

I found the problem...

I didn't have the close statement so I realy didn't see if there were any
exceptions thrown... And guess what - there were.

I got the "Old format or invalid type library. (Exception from HRESULT:
0x80028018 (TYPE_E_INVDATAREAD))" and had to set the culture to en-US.

For others needing the answer to this question, I changed the cultre info
like this:
System.Threading.Thread.CurrentThread.CurrentCultu re = new
System.Globalization.CultureInfo("en-US");

Now the current workbook closes - and not the excel application.


"neoret" wrote:

Yes, I've tried that. But then I quit every excel worksheet that is open...

My addin allows the user to archive the worksheet in an external archiving
system. The user may have many worksheets opened and I just want to close the
one he has just archived. Therefore I need to close the worksheet instance -
not the application.


"Arvi Laanemets" wrote:

Hi

Try this:
....
excelAppl.Quit


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"neoret" wrote in message
...
I have developed an addin using C#.

I need to close the application from my addin. I tired using the close
method like this:

private Microsoft.Office.Interop.Excel.Application excelAppl = null;
public Microsoft.Office.Interop.Excel.Workbook theActiveExcelWorkbook =
null;

excelAppl = (Microsoft.Office.Interop.Excel.Application)offApp lObject;
theActiveWorkbook = excelAppl.ActiveWorkbook;

this.theActiveWorkbook.Close(false, false, missing);

That does noe work. The code is called but nothing happens. No error
message
or nothing...

Do you have some advice for me on how to make this work.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
close excel application Brian Excel Programming 1 January 16th 06 08:09 AM
Trying to close Excel Application in IE Pommy Excel Discussion (Misc queries) 3 November 24th 05 03:36 PM
close excel application. VJ Excel Programming 3 October 22nd 04 03:00 AM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM


All times are GMT +1. The time now is 07:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"