Click here to Skip to main content
15,902,445 members
Home / Discussions / C#
   

C#

 
QuestionGetting Processsor ID without ManagementClass Pin
MrEyes27-Jun-07 3:58
MrEyes27-Jun-07 3:58 
AnswerRe: Getting Processsor ID without ManagementClass Pin
Luc Pattyn27-Jun-07 7:17
sitebuilderLuc Pattyn27-Jun-07 7:17 
Questionform minimized Pin
topksharma198227-Jun-07 3:30
topksharma198227-Jun-07 3:30 
AnswerRe: form minimized Pin
giddy_guitarist27-Jun-07 4:21
giddy_guitarist27-Jun-07 4:21 
GeneralRe: form minimized Pin
topksharma198227-Jun-07 4:43
topksharma198227-Jun-07 4:43 
GeneralRe: form minimized Pin
topksharma198227-Jun-07 5:05
topksharma198227-Jun-07 5:05 
GeneralRe: form minimized Pin
Luc Pattyn27-Jun-07 7:37
sitebuilderLuc Pattyn27-Jun-07 7:37 
QuestionDeleting a dynamically created Excel file Pin
snir_ya27-Jun-07 3:20
snir_ya27-Jun-07 3:20 
Hi all,

I've seen a lot of posts over the web about this issue but not even one(!) prudent solution.

I'm creating an excel file. Filling in some data, saving the excel and then when i'm trying to delete it i get the following exception:

"The process cannot access the file 'c:\temporaryFiles\ANLsnir_yarom_276200717848.xls' because it is being used by another process. "

Here's a code extract of the problem, a lot of progarammers would appriciate an answer for this riddle:

Excel.Application excelApp = new new Excel.Application();
Excel._Workbook workbook = (Excel._Workbook)excelApp.Workbooks.Add(Type.Missing);
Excel._Worksheet worksheet = (Excel._Worksheet)workbook.ActiveSheet;
//write into the excel and...
workbook.Close(ANL_Excel.vk_true, filePath, ANL_Excel.vk_false);
excelApp.Save(filePath);
excelApp.Quit();
Process[] pProcess;
pProcess = System.Diagnostics.Process.GetProcessesByName("Excel");
pProcess[0].Kill();

File.Delete(filePath);



Many Thanks,

Snir Yarom.
AnswerRe: Deleting a dynamically created Excel file Pin
Jimmanuel27-Jun-07 3:55
Jimmanuel27-Jun-07 3:55 
GeneralRe: Deleting a dynamically created Excel file Pin
snir_ya27-Jun-07 5:28
snir_ya27-Jun-07 5:28 
AnswerRe: Deleting a dynamically created Excel file Pin
mnaveed27-Jun-07 5:55
mnaveed27-Jun-07 5:55 
QuestionHow to create slip definition files in C# Pin
AR Reddy27-Jun-07 2:54
AR Reddy27-Jun-07 2:54 
JokeRe: How to create slip definition files in C# Pin
mav.northwind27-Jun-07 8:28
mav.northwind27-Jun-07 8:28 
QuestionProblem about bitmap in Visual Studio C Sharp.NET ? Pin
zeeShan anSari27-Jun-07 2:15
zeeShan anSari27-Jun-07 2:15 
AnswerRe: Problem about bitmap in Visual Studio C Sharp.NET ? Pin
Martin#27-Jun-07 2:28
Martin#27-Jun-07 2:28 
GeneralRe: Problem about bitmap in Visual Studio C Sharp.NET ? Pin
zeeShan anSari27-Jun-07 3:22
zeeShan anSari27-Jun-07 3:22 
GeneralRe: Problem about bitmap in Visual Studio C Sharp.NET ? Pin
Luc Pattyn27-Jun-07 7:42
sitebuilderLuc Pattyn27-Jun-07 7:42 
GeneralRe: Problem about bitmap in Visual Studio C Sharp.NET ? Pin
Martin#27-Jun-07 19:55
Martin#27-Jun-07 19:55 
AnswerRe: Problem about bitmap in Visual Studio C Sharp.NET ? Pin
Christian Graus27-Jun-07 3:20
protectorChristian Graus27-Jun-07 3:20 
GeneralRe: Problem about bitmap in Visual Studio C Sharp.NET ? Pin
zeeShan anSari27-Jun-07 3:33
zeeShan anSari27-Jun-07 3:33 
QuestionDisplaying data in two grids from three tables Pin
wasife27-Jun-07 1:54
wasife27-Jun-07 1:54 
AnswerRe: Displaying data in two grids from three tables Pin
Dave Sexton27-Jun-07 2:36
Dave Sexton27-Jun-07 2:36 
QuestionSet Encoding for Stream Writer Pin
t4ure4n27-Jun-07 1:07
t4ure4n27-Jun-07 1:07 
AnswerRe: Set Encoding for Stream Writer Pin
leppie27-Jun-07 1:10
leppie27-Jun-07 1:10 
GeneralRe: Set Encoding for Stream Writer Pin
t4ure4n27-Jun-07 1:16
t4ure4n27-Jun-07 1:16 

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.