|
-
December 10th, 2007, 02:49 PM
#1
Can't close an open excel application from VB
I'm having problems closing my excel application after using range and sort.
Here is a snippet of my code:
Set xApp = New Excel.Application
Set xBook = xApp.Workbooks.Open(filename)
Set xSheet = xBook.ActiveSheet
xSheet.Range("A12:I300).Sort(Columns("I"))
xBook.SaveAs OutPutFilename
xBook.Close True, OutPutFilename
xApp.quit
Set xSheet = Nothing
Set xBook = Nothing
Set xApp = Nothing
After this code executes I can open task manager and see that Excel is still open. Any help would be greatly appreciated. Thanks!
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
|