|
-
September 19th, 2001, 08:33 AM
#1
Need help in closing Excel Application...
Hi there, i´m new in coding VB, and just started in a Corp programing an application, that between other things, should be able to send data from a grid to a new Excel Book, but, after everything's done, the Excel is still running in the task manager, even after I set the var_Excel to Nothing... I've been trying to resolve this one since Monday, and my time is realy running out. I'de apreciate some help, urgent. Thanks.
FlipOver
-
September 19th, 2001, 08:51 AM
#2
Re: Need help in closing Excel Application...
private xlapp as Excel.Application
private xlWorkbooks as Excel.Workbooks
private xlWbook as Excel.Workbook
private xlSheet as Excel.Worksheet
private Sub Command1_Click()
Dim intI as Integer
set xlapp = new Excel.Application
xlapp.Visible = true
set xlWorkbooks = xlapp.Workbooks
xlWorkbooks.Open "c:\myxls.xls" 'your excel
for Each xlWbook In xlWorkbooks
for intI = 0 to xlWbook.Worksheets.Count - 1
set xlSheet = xlWbook.Worksheets(intI + 1)
Debug.print xlSheet.Name 'you will find more than one sheet here!
set xlSheet = nothing
next intI
next
'this will close everything
set xlWbook = nothing
xlWorkbooks.Close
set xlWorkbooks = nothing
xlapp.Quit
set xlapp = nothing
End Sub
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|