LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Excel Process Not Closed (C++) only after complete Application Shutdown

From what I have learned, in your example below, looks as though the "ws"
variable is a "Worksheet Collection" (may be declared as "ws As
Excel.Worksheets", and you are attempting to set it to a "Worksheet Object",
thus probably why it's not working. However, when you do the "GetSheets"
function, it resets the ws back to the proper collection.

I'm also assuming you are declaring your variables.

If you set a variable to a "Worksheet Object" such as the following VBA
declaration command:

Dim wsh As Excel.Worksheet 'Note, there is no "s" as the end to refer to the
object rather than the collection.

then what looks to be like your C++ command.

wsh = ws.Add( vOpt, vOpt, COleVariant((short)3),
COleVariant((short)XL_WORKSHEET) );

This way you don't get a "Mistype" error.

Glad to be of help to the extent possible. I have worked with Excel VBA
quite extensively and I'm also in the process of getting my MCSD cert
dealing with .NET programming. There's one main thing about the .NET
programming that I don't like about it, and it's the fact that it has gotten
away from using the Goto feature. I most certainly understand their
argument for it, but there are those rare occassions for it's use outside of
error catching. If anything, I generally use it more so for debugging and
error catching purposes than for anything else, but yet, there's those rare
exceptions to that rule.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Kevin" wrote in message
oups.com...
Hey Ronal thanks for your suggestions, in one way or another it helped
me find the problem... here is the solution... very weird how It came
about.

//Setting the result to ws for some reason ws wont work again, but
ws = ws.Add( vOpt, vOpt, COleVariant((short)3),
COleVariant((short)XL_WORKSHEET) );

//Setting this right after to re gain the objects properties for ws no
it works!
ws = _wb.GetSheets();

thanks all PROBLEM SOLVED!
-Kevin



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel window closed but process still running Jessica[_5_] Excel Programming 2 June 23rd 06 02:44 AM
Excel.Application.Quit leaving Excel process stays active Siggy Excel Programming 1 December 20th 04 09:26 AM
How to Kill Excel application process HoGo Excel Programming 2 December 13th 04 10:53 AM
Providing Estimate to Complete Info on a Process [email protected] Excel Programming 0 September 1st 04 07:51 PM
Mail merge issue - ghost Excel process remains after closing application d_b Excel Programming 1 August 16th 04 02:29 PM


All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"