.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

KILL THE EXE IN RUN-TIME

Posted By: Santosh     Posted Date: May 03, 2010    Points:2   Category :VB.Net
CAN ANY BODY PLZ TELL ME THE CODE

TO KILL THE (EXCEL EXE) IN RUN-TIME, AFTER GENERATE THE EXCEL SHEET DYNAMICALLY IN VB.NET

REGARDS
SANTOSH

Responses
Author: Lakhan Pal Garg             
Posted Date: May 03, 2010     Points: 5   

Hi
Check this :

Workbook.Save()
Workbook.Close()
Application.Quit()

System.Runtime.InteropServices.Marshal.ReleaseComObject(Application)

Worksheet = Nothing
Workbook = Nothing
Application = Nothing

Dim proc As System.Diagnostics.Process

For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")
proc.Kill()
Next


For More detail please visit this link : http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/a98b7675-c2d5-4036-bbde-53a3b88a4df5

Thanks
Lakhan Pal Garg
http://lakhangarg.blogspot.com

Author: Usha             
Posted Date: May 04, 2010     Points: 5   

Add this two namespaces, If u had not
using System.Diagnostics;
using System.Runtime.InteropServices;

And then try out this,

Process[] pProcess;
pProcess = System.Diagnostics.Process.GetProcessesByName("Excel");
pProcess[0].Kill();



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend