Click here to Skip to main content
15,915,328 members
Home / Discussions / C#
   

C#

 
GeneralRe: TreeView and Context Menu Pin
Guinness4Strength22-Dec-04 5:25
Guinness4Strength22-Dec-04 5:25 
GeneralRe: TreeView and Context Menu Pin
MarkMokris22-Dec-04 5:42
MarkMokris22-Dec-04 5:42 
Generalregistry policy settings refresh Pin
Pyro Joe22-Dec-04 4:54
Pyro Joe22-Dec-04 4:54 
GeneralRe: registry policy settings refresh Pin
Guinness4Strength22-Dec-04 5:21
Guinness4Strength22-Dec-04 5:21 
GeneralRe: registry policy settings refresh Pin
Pyro Joe22-Dec-04 5:40
Pyro Joe22-Dec-04 5:40 
GeneralRe: registry policy settings refresh Pin
Dave Kreskowiak22-Dec-04 6:39
mveDave Kreskowiak22-Dec-04 6:39 
GeneralRe: registry policy settings refresh Pin
Guinness4Strength22-Dec-04 6:39
Guinness4Strength22-Dec-04 6:39 
GeneralExcel Automation Questions Pin
Guinness4Strength22-Dec-04 4:18
Guinness4Strength22-Dec-04 4:18 
I have a few questions about Excel automation.
I've added a reference to the 9.0 Excel lib.

1. I'm able to automate Excel quite well but the instance of it will not close when I call the Application.Quit() method as in the following code:
ArrayList ToList = new ArrayList();
Excel.Application XLS = null;
Excel.Worksheet wsWorkSheet = null;
try
{
	XLS=new Excel.ApplicationClass();
	XLS.Workbooks.Open(FilePath,0, true, 5, "", "", 
		false, Excel.XlPlatform.xlWindows, "",true, false, 0, true);
//do stuff here.....
...
...
}
finally
{
	wsWorkSheet=null;
	object missingValue = Type.Missing ; 
	if(XLS!=null)
	{
		XLS.ActiveWorkbook.Close(false,missingValue,missingValue);
		XLS.Quit();
	}
	XLS=null;
}


Once my entire application closes the Excel instance closes but not when I call the Quit() method and set the instance varaible to null like I would expect it to.

2. At one point I allow the user to view the Excel Workbook currently being processed, it there any way I can catch the Excel close event, so the user cannot close the instance of Excel ?

3. Finally I was wondering if anyone had a simple way to tell if data is present in a particular WorkSheet. Right now I'm attemping to check the first 10 row of every sheet to see if there is data in them, but I suspect there is an easier way. Can I also interogate the WorkSheet for which Columns are in use ?
Questionocx or socketcommunication? Pin
stefan houtz22-Dec-04 4:08
stefan houtz22-Dec-04 4:08 
Generaldynamic assigning of class properties Pin
TyronX22-Dec-04 2:51
TyronX22-Dec-04 2:51 
GeneralRe: dynamic assigning of class properties Pin
J4amieC22-Dec-04 3:48
J4amieC22-Dec-04 3:48 
GeneralRe: dynamic assigning of class properties Pin
Skynyrd22-Dec-04 3:48
Skynyrd22-Dec-04 3:48 
GeneralRe: dynamic assigning of class properties Pin
TyronX22-Dec-04 10:43
TyronX22-Dec-04 10:43 
Generalget row number after datagrid sort Pin
jagberg2322-Dec-04 2:15
jagberg2322-Dec-04 2:15 
GeneralRe: get row number after datagrid sort Pin
aplope23-Dec-04 5:44
aplope23-Dec-04 5:44 
GeneralRe: get row number after datagrid sort Pin
jagberg2324-Dec-04 20:18
jagberg2324-Dec-04 20:18 
GeneralDesigning a data decisional application based-on grids and graphics Pin
guim722-Dec-04 2:09
guim722-Dec-04 2:09 
GeneralServiceController.WaitForStatus() method query Pin
ipsoftware22-Dec-04 2:06
ipsoftware22-Dec-04 2:06 
GeneralRe: ServiceController.WaitForStatus() method query Pin
Dave Kreskowiak22-Dec-04 6:17
mveDave Kreskowiak22-Dec-04 6:17 
GeneralTextBox caret jump Pin
Aviv Halperin22-Dec-04 1:18
Aviv Halperin22-Dec-04 1:18 
Generalon prepared statement in sql Pin
ting66822-Dec-04 0:11
ting66822-Dec-04 0:11 
GeneralRe: on prepared statement in sql Pin
David Salter22-Dec-04 0:24
David Salter22-Dec-04 0:24 
Generalhelp me shut dow xp white c# cod Pin
mehdidj21-Dec-04 20:56
mehdidj21-Dec-04 20:56 
GeneralRe: help me shut dow xp white c# cod Pin
J4amieC21-Dec-04 22:35
J4amieC21-Dec-04 22:35 
GeneralRe: help me shut dow xp white c# cod Pin
benjymous21-Dec-04 23:38
benjymous21-Dec-04 23:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.