Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 10th, 2009, 07:35 AM
Authorized User
Join Date: Aug 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Not been able to dispose the Excel Headers

Hi All,
am exporting a huge dataset to Excel.While doing this i have created mutiple excel sheet by segregating the dataset.My problem is that Headers of the First Excel sheet getting appended everytime a new excel sheet is created(not been able to dispose the Headers).I have use :-

excel = Nothing

but did not work.

also use the following function ...still no output:-

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Int32

Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32

Public Function TerminateExcel()
Dim ClassName As String = "XLMain"

Dim WindowHandle As Int32

Dim ReturnVal As Int32

Const WM_QUIT = &H12


WindowHandle = FindWindow(ClassName, Nothing)

If WindowHandle Then

ReturnVal = PostMessage(WindowHandle, WM_QUIT, 0, 0)

End If

Loop Until WindowHandle = 0

End Function

Please help to resolve this problem.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dispose() methods bpevangelista BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 2 May 12th, 2007 11:15 PM
Dispose Pattern guntank C# 0 September 26th, 2006 10:08 PM
Dispose() pzmrcd .NET Framework 1.x 2 March 2nd, 2006 03:19 PM
Question : Dispose mike_abc Pro VB.NET 2002/2003 1 May 14th, 2005 02:17 PM
dispose Ibn_Aziz C# 3 February 26th, 2004 05:17 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.