|
-
Jun 9th, 2000, 12:20 AM
#1
Thread Starter
Addicted Member
oXL.Quit
Set oXL = Nothing
Should do the trick. Are you sure you are opening only one instance of Excel? Sometimes people have both:
Set oXL = New Excel.Application
set oXL = CreateObject("Excel.Application")
or something similar and they actually open two instances of Excel. Make sure you only use one. You might want to post your code so we can look at it.
-
Jun 11th, 2000, 04:09 PM
#2
New Member
This is the bit of code that I use to open the book I need??
Is this correct???
Set oExcelApp = CreateObject("EXCEL.APPLICATION")
Set oWs = oExcelApp.ActiveSheet
Set MyBook = Workbooks.Open(FileName:="c:\Book1.XLS")
-
Jun 12th, 2000, 01:43 AM
#3
Thread Starter
Addicted Member
Try this:
Dim oExcelApp As Excel.Application
Set oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Workbooks.Open ("c:\Book1.XLS")
oExcelApp.ActiveWorkbook. do whatever
oExcelApp.Workbooks.Close
oExcelApp.Quit
Set oExcelApp = Nothing
You have to reference your workbooks and worksheets within the oExcelApp. In the new way of doing Office automation, you don't have separate stand-alone objects for each worksheet or workbook. They are all gotten to through the oExcelApp object.
By the way, I have tested this code and it deletes the Excel process.
-
Jun 12th, 2000, 10:05 PM
#4
New Member
Cheers HDR worked a treat. Must be where we were trying to open an application and then a workbook as seperate objects!
this has also solved the problem we had with saving the book a number of contiguous times!
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
|