Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Closing Applications

Does anyone know how to close an application that is "not" in the MS Office
Suite?

Following is code I used to create a new instance of the object, but can't
seem to find the method to close the application:

Sub OpenOtherApplication(FilePath, FileName)
Dim MMApp As New MindManager.Application
Dim FilePathAndName As String

FilePathAndName = FilePath & "\" & FileName

MMApp.Visible = True
MMApp.Documents.Open (FilePathAndName)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Closing Applications


Depends on the app you wan't to close.
if it supports VBA (autocad, microstation do)
you could use the getobject()
to instance the app and close it.

if it's not yuo will need api to find it's active window and handle
and close the thread (look at allapi.net for info on API)

N.B. this will require expoerience in VBA, a bit of VB and API


--
Dnereb


------------------------------------------------------------------------
Dnereb's Profile: http://www.excelforum.com/member.php...o&userid=26182
View this thread: http://www.excelforum.com/showthread...hreadid=482975

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Closing Applications

Dnereb:
My application won't close with GetObject/CreateObject as you suspected.
Thanks for your suggestion to explore the API, and the pointer to your site -
I'm able to close the app now.

Regards,
VBA Dabbler

"Dnereb" wrote:


Depends on the app you wan't to close.
if it supports VBA (autocad, microstation do)
you could use the getobject()
to instance the app and close it.

if it's not yuo will need api to find it's active window and handle
and close the thread (look at allapi.net for info on API)

N.B. this will require expoerience in VBA, a bit of VB and API


--
Dnereb


------------------------------------------------------------------------
Dnereb's Profile: http://www.excelforum.com/member.php...o&userid=26182
View this thread: http://www.excelforum.com/showthread...hreadid=482975


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Closing Applications

VBA Dabbler,
Does Intellisense not give you a list of correct methods/properties etc of
the MMApp object ?
You can also use the Object Browser to search the object's model.

A different point is the use of the "Dim MyObj As New XX" syntax.
Although has it's uses, one effect is that whenever you refer to MyObj in
code you create an instance of XX, if it does not currently exist. You do
not need this functionality, so split this line into the Dim and Set;
i.e. Dim MyObj As XX
Set MyObj = New XX

NickHK

"VBA Dabbler" wrote in message
...
Does anyone know how to close an application that is "not" in the MS

Office
Suite?

Following is code I used to create a new instance of the object, but can't
seem to find the method to close the application:

Sub OpenOtherApplication(FilePath, FileName)
Dim MMApp As New MindManager.Application
Dim FilePathAndName As String

FilePathAndName = FilePath & "\" & FileName

MMApp.Visible = True
MMApp.Documents.Open (FilePathAndName)
.
.
.
MMApp.ActiveDocument.Close
Set MMApp = Nothing
End Sub

The above code functions, but I can't close the application - an instance
remains with a virgin document - I have to manually close it.

Any help would be most appreciated.
Regards,
VBA Dabbler



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Closing Applications

NickHK,
Who is Intellisense? The MindManager app is from Mindjet Corporation. And
yes, I've browsed their object model using Object Browser. But, could not
find a close, quit, exit, etc. method for the Application object. I've also
sent a tech support request to Mindjet Corporation regarding this issue.

Thanks for the tip on the object declaration.

Regards,
VBA Dabbler

"NickHK" wrote:

VBA Dabbler,
Does Intellisense not give you a list of correct methods/properties etc of
the MMApp object ?
You can also use the Object Browser to search the object's model.

A different point is the use of the "Dim MyObj As New XX" syntax.
Although has it's uses, one effect is that whenever you refer to MyObj in
code you create an instance of XX, if it does not currently exist. You do
not need this functionality, so split this line into the Dim and Set;
i.e. Dim MyObj As XX
Set MyObj = New XX

NickHK

"VBA Dabbler" wrote in message
...
Does anyone know how to close an application that is "not" in the MS

Office
Suite?

Following is code I used to create a new instance of the object, but can't
seem to find the method to close the application:

Sub OpenOtherApplication(FilePath, FileName)
Dim MMApp As New MindManager.Application
Dim FilePathAndName As String

FilePathAndName = FilePath & "\" & FileName

MMApp.Visible = True
MMApp.Documents.Open (FilePathAndName)
.
.
.
MMApp.ActiveDocument.Close
Set MMApp = Nothing
End Sub

The above code functions, but I can't close the application - an instance
remains with a virgin document - I have to manually close it.

Any help would be most appreciated.
Regards,
VBA Dabbler




Reply
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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
How do I prevent all excel applications from closing at once? esg16 Excel Discussion (Misc queries) 1 March 27th 06 12:09 AM
Closing VB triggers closing Excel Minilek Excel Programming 2 August 6th 04 05:17 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM
Other applications Patrick Molloy[_4_] Excel Programming 2 July 23rd 03 12:08 AM


All times are GMT +1. The time now is 10:17 PM.

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"