Hi,
I am using Access 2003 to automate an Excel workbook, but after the
code completes Excel does not quit (at least it is still listed in
Task Manager --Processes.)
I have set a reference to the Excel 11.0 object library. I have
declared my Excel variables as...
Dim appExcel
Set appExcel = CreateObject("Excel.application")
... opened the file...
appExcel.Workbooks.Open ("c:\PhysicianUpdates\" & qdf.Name & ".xls")
... and clean up when done...
ActiveWorkbook.Save
appExcel.ActiveWorkbook.Saved = True
appExcel.Quit
Set appExcel = Nothing
Set rst = Nothing
Set qdf = Nothing
Set db = Nothing
Any ideas why Excel will not truly quit? Any help you can lend would
be appreciated.
Henry 4 4260
"Henry Stockbridge" <hs***********@hotmail.comwrote in message
<11**********************@s48g2000cws.googlegroups .com>:
Hi,
I am using Access 2003 to automate an Excel workbook, but after the
code completes Excel does not quit (at least it is still listed in
Task Manager --Processes.)
I have set a reference to the Excel 11.0 object library. I have
declared my Excel variables as...
Dim appExcel
Set appExcel = CreateObject("Excel.application")
.. opened the file...
appExcel.Workbooks.Open ("c:\PhysicianUpdates\" & qdf.Name & ".xls")
.. and clean up when done...
ActiveWorkbook.Save
appExcel.ActiveWorkbook.Saved = True
appExcel.Quit
Set appExcel = Nothing
Set rst = Nothing
Set qdf = Nothing
Set db = Nothing
Any ideas why Excel will not truly quit? Any help you can lend would
be appreciated.
Henry
You are using unqualified references to Excel objects.
ActiveWorkbook.Save needs to be
appExcel.ActiveWorkbook.Save
I'm more in favour of using a separate worbkook object
dim wr as object ' or Excel.Workbook
set wr = appExcel.Workbooks.Open("c:\PhysicianUpdates\" & qdf.Name &
".xls")
' do important stuff
wr.save
DoEvents
set wr = nothing
appExcel.Quit
set appExcel = nothing
BTW - you say you have set reference, but you declare your appExcel
as variant - for early binding
dim appExcel as Excel.Application
--
Roy-Vidar
On Feb 15, 3:51 pm, RoyVidar <roy_vidarNOS...@yahoo.nowrote:
"Henry Stockbridge" <hstockbrid...@hotmail.comwrote in message
<1171573235.953818.177...@s48g2000cws.googlegroups .com>:
Hi,
I am using Access 2003 to automate an Excel workbook, but after the
code completes Excel does not quit (at least it is still listed in
Task Manager --Processes.)
I have set a reference to the Excel 11.0 object library. I have
declared my Excel variables as...
Dim appExcel
Set appExcel = CreateObject("Excel.application")
.. opened the file...
appExcel.Workbooks.Open ("c:\PhysicianUpdates\" & qdf.Name & ".xls")
.. and clean up when done...
ActiveWorkbook.Save
appExcel.ActiveWorkbook.Saved = True
appExcel.Quit
Set appExcel = Nothing
Set rst = Nothing
Set qdf = Nothing
Set db = Nothing
Any ideas why Excel will not truly quit? Any help you can lend would
be appreciated.
Henry
You are using unqualified references to Excel objects.
ActiveWorkbook.Save needs to be
appExcel.ActiveWorkbook.Save
I'm more in favour of using a separate worbkook object
dim wr as object ' or Excel.Workbook
set wr = appExcel.Workbooks.Open("c:\PhysicianUpdates\" & qdf.Name &
".xls")
' do important stuff
wr.save
DoEvents
set wr = nothing
appExcel.Quit
set appExcel = nothing
BTW - you say you have set reference, but you declare your appExcel
as variant - for early binding
dim appExcel as Excel.Application
--
Roy-Vidar- Hide quoted text -
- Show quoted text -
Thanks, Roy. Unfortunately, it wasn't successful. The code is hooked
to the click event of a control on a form. If I close the database,
the Excel process ends. If the code were put into an independent
module instead on the click event of a control, might that solve the
problem?
Henry
"Henry Stockbridge" <hs***********@hotmail.comwrote in message
<11*********************@j27g2000cwj.googlegroups. com>:
On Feb 15, 3:51 pm, RoyVidar <roy_vidarNOS...@yahoo.nowrote:
>"Henry Stockbridge" <hstockbrid...@hotmail.comwrote in message
<1171573235.953818.177...@s48g2000cws.googlegroup s.com>:
>>Hi,
>>I am using Access 2003 to automate an Excel workbook, but after the code completes Excel does not quit (at least it is still listed in Task Manager --Processes.)
>>I have set a reference to the Excel 11.0 object library. I have declared my Excel variables as...
>>Dim appExcel Set appExcel = CreateObject("Excel.application") .. opened the file...
>>appExcel.Workbooks.Open ("c:\PhysicianUpdates\" & qdf.Name & ".xls") .. and clean up when done...
>>ActiveWorkbook.Save appExcel.ActiveWorkbook.Saved = True appExcel.Quit
>>Set appExcel = Nothing Set rst = Nothing Set qdf = Nothing
>>Set db = Nothing
>>Any ideas why Excel will not truly quit? Any help you can lend would be appreciated.
>>Henry
You are using unqualified references to Excel objects.
ActiveWorkbook.Save needs to be
appExcel.ActiveWorkbook.Save
I'm more in favour of using a separate worbkook object
dim wr as object ' or Excel.Workbook set wr = appExcel.Workbooks.Open("c:\PhysicianUpdates\" & qdf.Name & ".xls")
' do important stuff
wr.save DoEvents set wr = nothing appExcel.Quit set appExcel = nothing
BTW - you say you have set reference, but you declare your appExcel as variant - for early binding
dim appExcel as Excel.Application
-- Roy-Vidar- Hide quoted text -
- Show quoted text -
Thanks, Roy. Unfortunately, it wasn't successful. The code is
hooked to the click event of a control on a form. If I close the
database, the Excel process ends. If the code were put into an
independent module instead on the click event of a control, might
that solve the problem?
Henry
If this wasn't successfull, then I think it is possible that you use
more unqualified referencing in the rest of your code, that needs to
be amended. But to be of assistance, we would need a bit more than
"Unfortunately, it wasn't successfull".
I don't think there would be any difference whether this resides in
a separate module vs within a forms module, the code needs to be
without any implicit referencing of Excel objects, properties and
methods.
Here's one Microsoft KB article with some information on what I think
is the problem http://support.microsoft.com/default.aspx?kbid=178510
--
Roy-Vidar
On Feb 16, 2:42 am, RoyVidar <roy_vidarNOS...@yahoo.nowrote:
"Henry Stockbridge" <hstockbrid...@hotmail.comwrote in message
<1171580317.533874.99...@j27g2000cwj.googlegroups. com>:
On Feb 15, 3:51 pm, RoyVidar <roy_vidarNOS...@yahoo.nowrote:
"Henry Stockbridge" <hstockbrid...@hotmail.comwrote in message
<1171573235.953818.177...@s48g2000cws.googlegroups .com>:
>Hi,
>I am using Access 2003 to automate an Excel workbook, but after the code completes Excel does not quit (at least it is still listed in Task Manager --Processes.)
>I have set a reference to the Excel 11.0 object library. I have declared my Excel variables as...
>Dim appExcel Set appExcel = CreateObject("Excel.application") .. opened the file...
>appExcel.Workbooks.Open ("c:\PhysicianUpdates\" & qdf.Name & ".xls") .. and clean up when done...
>ActiveWorkbook.Save appExcel.ActiveWorkbook.Saved = True appExcel.Quit
>Set appExcel = Nothing Set rst = Nothing Set qdf = Nothing
>Set db = Nothing
>Any ideas why Excel will not truly quit? Any help you can lend would be appreciated.
>Henry
You are using unqualified references to Excel objects.
ActiveWorkbook.Save needs to be
appExcel.ActiveWorkbook.Save
I'm more in favour of using a separate worbkook object
dim wr as object ' or Excel.Workbook
set wr = appExcel.Workbooks.Open("c:\PhysicianUpdates\" & qdf.Name &
".xls")
' do important stuff
wr.save
DoEvents
set wr = nothing
appExcel.Quit
set appExcel = nothing
BTW - you say you have set reference, but you declare your appExcel
as variant - for early binding
dim appExcel as Excel.Application
--
Roy-Vidar- Hide quoted text -
- Show quoted text -
Thanks, Roy. Unfortunately, it wasn't successful. The code is
hooked to the click event of a control on a form. If I close the
database, the Excel process ends. If the code were put into an
independent module instead on the click event of a control, might
that solve the problem?
Henry
If this wasn't successfull, then I think it is possible that you use
more unqualified referencing in the rest of your code, that needs to
be amended. But to be of assistance, we would need a bit more than
"Unfortunately, it wasn't successfull".
I don't think there would be any difference whether this resides in
a separate module vs within a forms module, the code needs to be
without any implicit referencing of Excel objects, properties and
methods.
Here's one Microsoft KB article with some information on what I think
is the problemhttp://support.microsoft.com/default.aspx?kbid=178510
--
Roy-Vidar- Hide quoted text -
- Show quoted text -
Many thanks for the help. I qualified my range and cell objects and
now everything works like a charm.
Henry This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sri |
last post by:
I am writing an asp.net applicaition using VB coding.
In a function, I am opening an excel file with the following code,
Dim objExcel As Object
Dim objWorkBook As Object
objExcel =...
|
by: Lars-Erik Aabech |
last post by:
Hi!
This issue have been discussed a lot, but I haven't found a solution that
applies to ASP.NET. I have a library which does some operations on Excel
documents, and it will be used in an...
|
by: Praveen K |
last post by:
I have a problem in communicating between the C# and the Excel Interop
objects. The problem is something as described below.
I use Microsoft Office-XP PIA dll’s as these dll’s were been...
|
by: Powerguy |
last post by:
Hi all,
I am looking for a way to get the Process id (or a handle) of an EXCEL
process created from within my code.
For example when the following code is executed:
Dim EXL As...
|
by: lgbjr |
last post by:
Hi All,
I have a VB.NET app that, among other things, writes data to Excel. I am
having trouble getting the Excel process to terminate after I quit Excel. I
found an article related to this...
|
by: LP |
last post by:
Hello,
I am trying to use .NET with Excel. I installed Office 2003 and selected
..NET programming suport option, so it installed all those PIA, as MS
sugests. But I can not find a way to destroy...
|
by: mabond |
last post by:
Hi
recently read a posting and reply about Excel processs still running after
the Appliction.Quit was called. Thought I might be able to use the same...
|
by: fakehitswizard |
last post by:
this is the correct way to close excel with C#. I've seen alot of other bogus posts ALL over the web that don't work, how frustrating.
string savepath;
bool foundPID;
int ourPID = 0;
int...
|
by: =?Utf-8?B?VGVycnkgSG9sbGFuZA==?= |
last post by:
I have a vb.net app that opens an excel worksheet, reads data and then closes
the sheet. Im noticing that the Excel process is still running after I have
closed and disposed of my excel objects.
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |